BlueSpruce
Well-known member
- Local time
- Today, 08:53
- Joined
- Jul 18, 2025
- Messages
- 1,116
I cannot understand why the code below is running the report when pressing the enter key despite setting the default button to "No" .
Code:
Private Sub cmdPrintReceipt_Click()
Dim response as String
response = MsgBox("Print Customer Receipt?", vbYesNo + vbDefaultButton2)
If response = vbYes Then DoCmd.OpenReport "rptPrintCustomerReceipt", , , "[ContractNo] = " & Me.ContractNo
End Sub
Last edited: