
Passing parameter field variable to report
Sorry, I'm being thick here.
What is the .... after the from
I have included the code blow from VB5 for one of my reports. As you
will see I already have some selection criteria in there for the
dates, which works fine. All I want to do is to pass the date into
the report heading.
Private Sub cmd1_Click()
On Error GoTo cmd1_clickERR
Dim StartDate, EndDate, Low, High As String
Dim RecordDate, RecSelect As String
StartDate = txtFrom.Text
EndDate = txtTo.Text
Low = "Date(19" & Right$(StartDate, 2) & "," & Mid$(StartDate, 4,
2)
Low = Low & "," & Left$(StartDate, 2) & ")"
High = "Date(19" & Right$(EndDate, 2) & "," & Mid$(EndDate, 4, 2)
High = High & "," & Left$(EndDate, 2) & ")"
RecordDate = "{CONTRACT.start}"
If gCmd1_date = True Then
RecSelect = RecordDate & " in " & Low & " to " & High
Else
RecSelect = ""
End If
If chkDealer.Value = 1 And gCmd1_Dealer = True Then
cboDealerID.ListIndex = cboDealer.ListIndex
RecSelect = RecSelect & " AND {CONTRACT.dealer} = " &
cboDealerID.Text
End If
CRgeneral.ReportFileName = RepPat & gCmd1_Report
CRgeneral.DataFiles(0) = DBpath + "\fm.mdb"
CRgeneral.SelectionFormula = RecSelect$
CRgeneral.Action = 1
Exit Sub
cmd1_clickERR:
MsgBox Err.Description, vbInformation
End Sub
Quote:
>to_date, * from .....
>Billy Lau
>>unfortunately I am using VB5
>>>says...
>>>> How do I create a formula in C.R. to display the date that I have used
>>>> in the selection criteria to be shown on the page (I want the title to
>>>> show XXX report From --/--/-- To --/--/--)
>>>In 6, you can just drag the parameter fields into your Text object. If
>>>you are using the VB version, I can't check the answer....