The below command button works until the report is called at which time the query parameter is missing from the report, however, if I type the dates in and by-pass the button, the parameters are displayed on the report. Please help...
This routine is activated after I select a start and end date from a form containing a calendar.
Private Sub cmdSetDates_Click()
On Error GoTo cmdSetDates_Error
If cmdSetDates.Caption = "Set Beginning Date" Then
Me.WhatFromDate = calSetDates.Value
cmdSetDates.Caption = "Set Ending Date"
Else
Me.WhatToDate = calSetDates.Value
cmdSetDates.Caption = "Set Beginning Date"
End If
Exit Sub
cmdSetDates_Error:
MsgBox "Error # " & Err.Number & ": " & Err.Description
Exit Sub
End Sub
After selecting the dates I have a command button which takes me to a Print Menu where I select
how I which to save or print the data, for import into Map Point.
This same button loads my query, which collects my requested data between the two dates.
Here is where my problem lies. If I use Set Date Button above, the query works fine, except
that it will not place the Beginning and Ending Dates on my report. But, if I manually
enter the dates, ignoring the above routine, the dates appear on my report as:
Stats Beginning: 05/01/02 and Ending 05/22/02. Using the button it appears as
Stats Beginning: Ending.
Any advise on how to go automated all the way.
Thanks, Sonny
This routine is activated after I select a start and end date from a form containing a calendar.
Private Sub cmdSetDates_Click()
On Error GoTo cmdSetDates_Error
If cmdSetDates.Caption = "Set Beginning Date" Then
Me.WhatFromDate = calSetDates.Value
cmdSetDates.Caption = "Set Ending Date"
Else
Me.WhatToDate = calSetDates.Value
cmdSetDates.Caption = "Set Beginning Date"
End If
Exit Sub
cmdSetDates_Error:
MsgBox "Error # " & Err.Number & ": " & Err.Description
Exit Sub
End Sub
After selecting the dates I have a command button which takes me to a Print Menu where I select
how I which to save or print the data, for import into Map Point.
This same button loads my query, which collects my requested data between the two dates.
Here is where my problem lies. If I use Set Date Button above, the query works fine, except
that it will not place the Beginning and Ending Dates on my report. But, if I manually
enter the dates, ignoring the above routine, the dates appear on my report as:
Stats Beginning: 05/01/02 and Ending 05/22/02. Using the button it appears as
Stats Beginning: Ending.
Any advise on how to go automated all the way.
Thanks, Sonny