I used to have a button in my regular form that when I clicked it a report would generate for ONLY that CURRENT form. I set the parameters so that I would a number of pop up windows would come up and I would type in the information. (Used a query for the report record source and text boxes with parameters.)
NOW...
When I click the button on the form, it brings up another form that I just select things that will go in the report instead of typing them all in individually but I don't know how to get it to bring up the report for JUST the current form.
I would like to attach a screen shot but not sure which one would be best.
The code i HAD was....
Private Sub btnPWMSO_Click()
On Error GoTo Err_btnPWMSO_Click
Dim stLinkCriteria As String
If Me.Dirty Then Me.Dirty = False
stLinkCriteria = "[Serial Number] = " & Chr(34) & Me![Serial number] & Chr(34)
DoCmd.OpenReport "rptPWMSO", acViewPreview, , stLinkCriteria
Exit_btnPWMSO_Click:
Exit Sub
Err_btnPWMSO_Click:
MsgBox Err.Description
Resume Exit_btnPWMSO_Click
End Sub
The code I have NOW is....
Private Sub btnPWMSO_Click()
On Error GoTo Err_btnPWMSO_Click
Dim stLinkCriteria As String
If Me.Dirty Then Me.Dirty = False
stLinkCriteria = "[Serial Number] = " & Chr(34) & Me![Serial number] & Chr(34)
DoCmd.OpenForm "frmPWMSO", acNormal, , stLinkCriteria
Exit_btnPWMSO_Click:
Exit Sub
Err_btnPWMSO_Click:
MsgBox Err.Description
Resume Exit_btnPWMSO_Click
End Sub
Make sense?
NOW...
When I click the button on the form, it brings up another form that I just select things that will go in the report instead of typing them all in individually but I don't know how to get it to bring up the report for JUST the current form.
I would like to attach a screen shot but not sure which one would be best.
The code i HAD was....
Private Sub btnPWMSO_Click()
On Error GoTo Err_btnPWMSO_Click
Dim stLinkCriteria As String
If Me.Dirty Then Me.Dirty = False
stLinkCriteria = "[Serial Number] = " & Chr(34) & Me![Serial number] & Chr(34)
DoCmd.OpenReport "rptPWMSO", acViewPreview, , stLinkCriteria
Exit_btnPWMSO_Click:
Exit Sub
Err_btnPWMSO_Click:
MsgBox Err.Description
Resume Exit_btnPWMSO_Click
End Sub
The code I have NOW is....
Private Sub btnPWMSO_Click()
On Error GoTo Err_btnPWMSO_Click
Dim stLinkCriteria As String
If Me.Dirty Then Me.Dirty = False
stLinkCriteria = "[Serial Number] = " & Chr(34) & Me![Serial number] & Chr(34)
DoCmd.OpenForm "frmPWMSO", acNormal, , stLinkCriteria
Exit_btnPWMSO_Click:
Exit Sub
Err_btnPWMSO_Click:
MsgBox Err.Description
Resume Exit_btnPWMSO_Click
End Sub
Make sense?