C
CH
I currently have the coding that allows me to "Print only the Current
Record" to a report. That report is named "rptAllAreas" and the
coding works fine and looks like this:
******************** Code Start *********************
Private Sub cmdPrint_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no saved data or is currently in
Edit mode. Use the arrow buttons to select another record, then
reselect." _, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptAllAreas"
strCriteria = "[ID]= " & Me![ID]
DoCmd.OpenReport strReportName, acViewNormal, , strCriteria
End If
End Sub
'******************** Code End ************************
What I am looking to do (I am a newbie) is to extend this "Print only
the Current Record" ability. I want to include coding that instead
of printing the one report, would print one of the three (3) following
reports:
rptAllAreas
rptABCArea
rptXYZArea
This would be based on the "Select Area" field (strArea) of the
displayed record. Could someone provide any help with the coding that
would be involved, and how it includes the above pieces?
Thanks..CH
Record" to a report. That report is named "rptAllAreas" and the
coding works fine and looks like this:
******************** Code Start *********************
Private Sub cmdPrint_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no saved data or is currently in
Edit mode. Use the arrow buttons to select another record, then
reselect." _, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "rptAllAreas"
strCriteria = "[ID]= " & Me![ID]
DoCmd.OpenReport strReportName, acViewNormal, , strCriteria
End If
End Sub
'******************** Code End ************************
What I am looking to do (I am a newbie) is to extend this "Print only
the Current Record" ability. I want to include coding that instead
of printing the one report, would print one of the three (3) following
reports:
rptAllAreas
rptABCArea
rptXYZArea
This would be based on the "Select Area" field (strArea) of the
displayed record. Could someone provide any help with the coding that
would be involved, and how it includes the above pieces?
Thanks..CH