smtazulislam
Member
- Local time
- Today, 13:36
- Joined
- Mar 27, 2020
- Messages
- 808
Hello,
can anyone talk me where I have mistake ? one report opened, second report not opening
tried it
can anyone talk me where I have mistake ? one report opened, second report not opening
Code:
Private Sub cmdPrint_Click()
DoCmd.Save
If IsNull(Me.txtDateFrom) Then
MsgBox "Please select a valid record", vbOKOnly, "Data Required"
End If
If Me.txtPreviousSalary > 1 Then
DoCmd.OpenReport "rptIncrasingSalary", acViewPreview, "", "[SalaryID] = " & Me!txtSalaryID, acWindowNormal
DoCmd.RunCommand acCmdPrint
Debug.Print
Else
If Me.txtPreviousSalary < 1 Then
DoCmd.OpenReport "rptDecreaseSalary", acViewPreview, "", "[SalaryID] = " & Me!txtSalaryID, acWindowNormal
DoCmd.RunCommand acCmdPrint
Debug.Print
End If
End If
End Sub
tried it
Code:
Private Sub cmdPrint_Click()
DoCmd.Save
If IsNull(Me.txtDateFrom) Then
MsgBox "Please select a valid record", vbOKOnly, "Date Required"
Me.txtDateFrom.SetFocus
End If
If Me.txtPreviousSalary >= 1 Then
DoCmd.OpenReport "rptIncrasingSalary", acViewPreview, "", "[SalaryID] = " & Me!txtSalaryID, acWindowNormal
DoCmd.RunCommand acCmdPrint
Debug.Print
Else
If Me.txtPreviousSalary >= -1 Then
DoCmd.OpenReport "rptDecreaseSalary", acViewPreview, "", "[SalaryID] = " & Me!txtSalaryID, acWindowNormal
DoCmd.RunCommand acCmdPrint
Debug.Print
End If
End If
End Sub