R
Rob W
Greetings,
I originally used a button on a from created via the button wizard to run my
report which was based on a query.
Since I wanted to add some validation I removed the button and added my own
code (as below):-
However the open report is just a preview and the user cant exit the preview
screen with directly using access controls.
I cant use the DoCmd.RunReport method :-(
I want to create report output and then use buttons on the report output
allowing for more user navigation.
How do I run reports and allow the screen to include the actual report
output with workable buttons etc..,?
Hope this makes sense.
Thanks Rob
Private Sub cmdopenreport_Enter()
On Error GoTo Report_NoData_Error
If IsNull(cboStudentid) Then
MsgBox "Please choose a student Id", vbCritical
cboStudentid.SetFocus
Else
DoCmd.OpenReport "rptStudentClassification", acViewPreview
' DoCmd.RunReport "rptStudentClassification"
End If
Report_NoData_Exit:
Exit Sub
Report_NoData_Error:
If Err.Number = 2501 Then 'the report was cancelled
Exit Sub
Else
MsgBox Err.Number & " - " & Err.Description
Resume Report_NoData_Exit
End If
End Sub
I originally used a button on a from created via the button wizard to run my
report which was based on a query.
Since I wanted to add some validation I removed the button and added my own
code (as below):-
However the open report is just a preview and the user cant exit the preview
screen with directly using access controls.
I cant use the DoCmd.RunReport method :-(
I want to create report output and then use buttons on the report output
allowing for more user navigation.
How do I run reports and allow the screen to include the actual report
output with workable buttons etc..,?
Hope this makes sense.
Thanks Rob
Private Sub cmdopenreport_Enter()
On Error GoTo Report_NoData_Error
If IsNull(cboStudentid) Then
MsgBox "Please choose a student Id", vbCritical
cboStudentid.SetFocus
Else
DoCmd.OpenReport "rptStudentClassification", acViewPreview
' DoCmd.RunReport "rptStudentClassification"
End If
Report_NoData_Exit:
Exit Sub
Report_NoData_Error:
If Err.Number = 2501 Then 'the report was cancelled
Exit Sub
Else
MsgBox Err.Number & " - " & Err.Description
Resume Report_NoData_Exit
End If
End Sub