G
Guest
I want to print the current record in the form, I am using the following code:
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 = "[EmployeeID] = " & Me.[EmployeeID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
The report opens , but it is showing me all the records not just one. The
form I am using has 3 subforms on seperate Tabs, Is this causing my problem?
thanks
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 = "[EmployeeID] = " & Me.[EmployeeID]
DoCmd.OpenReport "MyReport", acViewPreview, , strWhere
End If
End Sub
The report opens , but it is showing me all the records not just one. The
form I am using has 3 subforms on seperate Tabs, Is this causing my problem?
thanks