A
April Slater via AccessMonster.com
I have a form built to allow users to filter the database using three
critieria. I have an unbound lookup table for ?Contract Type?,
?Discipline? and ?Project Name?. On the form I have three command buttons
for ?View Report?, ?Print Report? and ?Exit?. I can?t seem to figure out
how to write the code to make the reports come out with the specified data.
Not only that, but I need it to accept Null values in any of the criteria
if any of the three match for the report. Can you help me?? Yes, I?m a
newbie trying to work it out. Here is my code at this point, but I?m only
testing on the View Report Command.
Private Sub View_Report_Click()
On Error GoTo Err_View_Report_Click
Dim strWhere As String
strWhere = "[Contract Type]" & strWhere = "[Discipline]" & strWhere = "
[Project Name]"
stDocName = "Lessons Learned"
DoCmd.OpenReport stDocName, acPreview
Exit_View_Report_Click:
Exit Sub
Err_View_Report_Click:
MsgBox Err.Description
Resume Exit_View_Report_Click
End Sub
Private Sub Exit_Click()
On Error GoTo Err_Exit_Click
DoCmd.Close
Exit_Exit_Click:
Exit Sub
Err_Exit_Click:
MsgBox Err.Description
Resume Exit_Exit_Click
End Sub
Private Sub Print_Report_Click()
On Error GoTo Err_Print_Report_Click
Dim stDocName As String
stDocName = "Lessons Learned"
DoCmd.OpenReport stDocName, acNormal
Exit_Print_Report_Click:
Exit Sub
Err_Print_Report_Click:
MsgBox Err.Description
Resume Exit_Print_Report_Click
End Sub
critieria. I have an unbound lookup table for ?Contract Type?,
?Discipline? and ?Project Name?. On the form I have three command buttons
for ?View Report?, ?Print Report? and ?Exit?. I can?t seem to figure out
how to write the code to make the reports come out with the specified data.
Not only that, but I need it to accept Null values in any of the criteria
if any of the three match for the report. Can you help me?? Yes, I?m a
newbie trying to work it out. Here is my code at this point, but I?m only
testing on the View Report Command.
Private Sub View_Report_Click()
On Error GoTo Err_View_Report_Click
Dim strWhere As String
strWhere = "[Contract Type]" & strWhere = "[Discipline]" & strWhere = "
[Project Name]"
stDocName = "Lessons Learned"
DoCmd.OpenReport stDocName, acPreview
Exit_View_Report_Click:
Exit Sub
Err_View_Report_Click:
MsgBox Err.Description
Resume Exit_View_Report_Click
End Sub
Private Sub Exit_Click()
On Error GoTo Err_Exit_Click
DoCmd.Close
Exit_Exit_Click:
Exit Sub
Err_Exit_Click:
MsgBox Err.Description
Resume Exit_Exit_Click
End Sub
Private Sub Print_Report_Click()
On Error GoTo Err_Print_Report_Click
Dim stDocName As String
stDocName = "Lessons Learned"
DoCmd.OpenReport stDocName, acNormal
Exit_Print_Report_Click:
Exit Sub
Err_Print_Report_Click:
MsgBox Err.Description
Resume Exit_Print_Report_Click
End Sub