R
ryan.fitzpatrick3
I was reading on Allen Brown's website about printing a report from a
form record selection. I have a question regarding this. I have a main
form that has 3 subforms, which are all linked back to the main form.
How do I 1) create a form to incorporate all of this data and 2) how
do I change this code that is on his page to reflect this, or do I
have to change it?
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
thanks in advance
Ryan
form record selection. I have a question regarding this. I have a main
form that has 3 subforms, which are all linked back to the main form.
How do I 1) create a form to incorporate all of this data and 2) how
do I change this code that is on his page to reflect this, or do I
have to change it?
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[ID] = " & Me.[ID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
thanks in advance
Ryan