smtazulislam
Member
- Local time
- Today, 17:42
- Joined
- Mar 27, 2020
- Messages
- 806
Hello everyone, good day !
I want to printout from a sub(form) as same row data, see attached picture. But its print out all entries with selected EmployeeID.
I try to code like :
I want to printout from a sub(form) as same row data, see attached picture. But its print out all entries with selected EmployeeID.
I try to code like :
Code:
Private Sub cmdPrint_Click()
On Error GoTo cmdPrint_Click_Err
If IsNull(Me.EmployeeID) Then
MsgBox "Please select a valid record", vbOKOnly, "Data Required"
End If
DoCmd.OpenReport "rptPenality", acViewPreview, "", "[AttID] = " & Me!txtAttID, acWindowNormal,
DoCmd.Close acForm, "frmEmployee"
DoCmd.RunCommand acCmdPrint
Debug.Print
cmdPrint_Click_Exit:
Exit Sub
cmdPrint_Click_Err:
MsgBox Error$
Resume cmdPrint_Click_Exit
End Sub
Last edited: