smtazulislam
Member
- Local time
- Today, 22:03
- Joined
- Mar 27, 2020
- Messages
- 806
Hello, Any help will appreciate.
this is my form
I tried to print SN-2 into 72 Record Numbers, But its printing SN-1 Record numbers 32 with Cancellation Report.
Here is code :
this is my form
I tried to print SN-2 into 72 Record Numbers, But its printing SN-1 Record numbers 32 with Cancellation Report.
Here is code :
Code:
Private Sub cmdPrint_Click()
On Error GoTo cmdPrint_Click_Err
Me.Requery
If IsNull(Me.txtEffectiveDate) Then
MsgBox "Please select a valid record", vbOKOnly, "Data Required"
End If
If IsNull(Me.txtCancelDate) Then
DoCmd.OpenReport "rptAllowanceCancelation", acViewPreview, "", "[AllowanceID] = " & Me!txtAllowanceID, acWindowNormal
DoCmd.RunCommand acCmdPrint
Debug.Print
ElseIf Not IsNull(Me.txtCancelDate ) Then
DoCmd.OpenReport "rptAllowance", acViewPreview, "", "[AllowanceID] = " & Me!txtAllowanceID, acWindowNormal
DoCmd.RunCommand acCmdPrint
Debug.Print
End If
'Tried it also
'If IsNull(Me.txtCancelDate ) And Me.Active = 1 Then
' DoCmd.OpenReport "rptAllowance", acViewPreview, "", "[AllowanceID] = " & Me!txtAllowanceID, acWindowNormal
' DoCmd.RunCommand acCmdPrint
' Debug.Print
'
'ElseIf Not IsNull(Me.txtCancelDate) And Me.Active = -1 Then
' DoCmd.OpenReport "rptAllowanceCancelation", acViewPreview, "", "[AllowanceID] = " & Me!txtAllowanceID, acWindowNormal
' DoCmd.RunCommand acCmdPrint
' Debug.Print
'
'End If
cmdPrint_Click_Exit:
Exit Sub
cmdPrint_Click_Err:
MsgBox Error$
Resume cmdPrint_Click_Exit
End Sub