deejay_totoro
Registered User.
- Local time
- Today, 22:27
- Joined
- May 29, 2003
- Messages
- 169
Hello all,
I have a question concerning the preview of reports - based on a user selection.
So far, this is what I have done.
I created a blank form. On that form I created a drop-down combo box. This combo references a table that contains the exact names of the reports I have already created.
To preview the report, the user clicks on a "Preview Report" button. The combo selection is passed to the button code as follows:
Option Compare Database
Private Sub buttonPreviewReport_Click()
On Error GoTo Err_buttonPreviewReport_Click
Dim stDocName As String
'ReportName is received from the combo selection
stDocName = ReportName
DoCmd.OpenReport stDocName, acPreview
Exit_buttonPreviewReport_Click:
Exit Sub
Err_buttonPreviewReport_Click:
MsgBox Err.Description
Resume Exit_buttonPreviewReport_Click
End Sub
This appears to work fine. The problem now comes when, for example, I want the underlying query for each report to receive some user parameters, for example, datestart, dateend, or a report based on a particular user name.
So how do I go about this? How do I send information based on a combo to the underlying query before it is made?
Thank you very much!
dj_T
I have a question concerning the preview of reports - based on a user selection.
So far, this is what I have done.
I created a blank form. On that form I created a drop-down combo box. This combo references a table that contains the exact names of the reports I have already created.
To preview the report, the user clicks on a "Preview Report" button. The combo selection is passed to the button code as follows:
Option Compare Database
Private Sub buttonPreviewReport_Click()
On Error GoTo Err_buttonPreviewReport_Click
Dim stDocName As String
'ReportName is received from the combo selection
stDocName = ReportName
DoCmd.OpenReport stDocName, acPreview
Exit_buttonPreviewReport_Click:
Exit Sub
Err_buttonPreviewReport_Click:
MsgBox Err.Description
Resume Exit_buttonPreviewReport_Click
End Sub
This appears to work fine. The problem now comes when, for example, I want the underlying query for each report to receive some user parameters, for example, datestart, dateend, or a report based on a particular user name.
So how do I go about this? How do I send information based on a combo to the underlying query before it is made?
Thank you very much!
dj_T