gojets1721
Registered User.
- Local time
- Yesterday, 21:23
- Joined
- Jun 11, 2019
- Messages
- 430
Terrible title, I'm sorry.
I have a form that looks at record one at a time. For whatever record I'm on, I want to use VBA via a command to check if that record's ComplaintNumber is listed at all in a completely separate table (tblEmployees). This table also has a ComplaintNumber field.
Here's the IF function I'm using:
The issue is that it's always saying that values are present even though there aren't. Any suggestions? Let me know if an example DB is needed.
I have a form that looks at record one at a time. For whatever record I'm on, I want to use VBA via a command to check if that record's ComplaintNumber is listed at all in a completely separate table (tblEmployees). This table also has a ComplaintNumber field.
Here's the IF function I'm using:
Code:
If ("SELECT ComplaintNumber FROM tblEmployees WHERE [ComplaintNumber] =" & [Forms]![frmComplaints]![ComplaintNumber]) = "" Then
MsgBox "No Values present in tblEmployees"
Else
MsgBox "Values present in tblEmployees"
End If
The issue is that it's always saying that values are present even though there aren't. Any suggestions? Let me know if an example DB is needed.