matthewnsarah07
Registered User.
- Local time
- Today, 10:24
- Joined
- Feb 19, 2008
- Messages
- 192
I have got the following DCount code set up in a command button that is supposed to only allow the frmppe to open if the [Staffname] on MainForm is not present in qryppe.
The code runs fine but no matter whether a name entered on the form is in the query or not the frmppe still opens regardless, What is missing from this code to make it work properly??
Thanks
The code runs fine but no matter whether a name entered on the form is in the query or not the frmppe still opens regardless, What is missing from this code to make it work properly??
Thanks
Code:
Private Sub Command6_Click()
If DCount("[StaffName]", "qryppe", "[StaffName]=' " & Forms("MainForm").Staffname & "'") > 0 Then Exit Sub
DoCmd.OpenForm "frmppe", acNormal
End Sub