label

i am using the vb data report and i need to place a label into the report header.
i know i can use
lblUser = form1.cbo.text
but have no idea where to put this so that the report initilizes that befor execution.
any ideas would be great,
thanks
j
[280 byte] By [jamoon] at [2007-11-18 2:14:40]
# 1 Re: label
Usually in the Report_Open method ... You will have to view the report code and make that happen tho ...

Example:

Private Sub Report_Open(Cancel As Integer)
If IsNull(Me.OpenArgs) Then
MsgBox "This report can only be run from the Purchase Order Entry form.", vbExclamation, "System Monitor"
Cancel = 1
Exit Sub
End If

Dim NumberOfPages As Long

DBConnectionActive = False
IsOK = EstablishDBConnection
If IsOK = 0 Then
Cancel = 1
Exit Sub
End If
DBConnectionActive = True

Dim ParmListString() As String

'
' Format:
'
' PO Table, PO Line Item Table, Official Doc, Hot, ReqName, Dept, Ph, Fax,
' VendorID, Name, Address, Contact, Ph, Fax
'
ParmListString = Split(Me.OpenArgs, ",", -1, vbTextCompare)
Me.RecordSource = ParmListString(0)
LineItemsTbl = ParmListString(1)
IsOfficial = CBool(ParmListString(2))
If IsOfficial Then OfficialLbl.Visible = False
IsHot = CBool(ParmListString(3))
If Not IsHot Then HotLbl.Visible = False

ReqNameTxt.Caption = ParmListString(4)
DeptTxt.Caption = ParmListString(5)
ReqPhoneTxt.Caption = ParmListString(6)
ReqFaxTxt.Caption = ParmListString(7)
VendorIDTxt.Caption = ParmListString(8)
SupNameTxt.Caption = ParmListString(9)
AddressTxt.Caption = ParmListString(10)
ContactTxt.Caption = ParmListString(11)
ConPhoneTxt.Caption = ParmListString(12)
ConFaxTxt.Caption = ParmListString(13)

'If CDate(ExpirationTxt) < Date Then ExpiredLbl.Visible = True

RetrievePOLineItems

If ItemRecCount > 3 Then
NumberOfPages = 1 + Int((ItemRecCount - 3) / 5)
If ((ItemRecCount - 3) Mod 5) > 0 Then NumberOfPages = NumberOfPages + 1
PgLbl.Caption = "Page: 1 of " & NumberOfPages
End If
End Sub

There are quite a few things that can be done in reports ...

- Mike
M Owen at 2007-11-10 0:02:29 >