I am designing an order form and I would like to restrict access to submit the form to certain employees. In the employees table, I have their name, their password (which is different for each employee), and different check box fields that denote what that employee can do. So for example, Employee A might have a password of Password and have the field 'Can_Submit_Request' checked. I have tried the following code which I found and modified when looking into this earlier:
If Me.txPassword = DLookup("Password", "Employee", "Employee_ID='" & YourEmployee_ID & "'") Then
If Nz(DLookup("Can_Submit", "Employee", "Employee='" & YourEmployee_ID & "'") , False) = True Then
'/ continue on to the Submit process
Else
Msgbox "You do not have permission to submit"
End If
Else
Msgbox "Invalid Password"
End If
This received an error of "Data type mismatch in criteria expression", and admittedly I don't really know what the criteria is doing, especially the YourEmployee_ID part. I'm very new to Access and VBA and have tried looking up how to use DLookup to no avail, so any help with this would be greatly appreciated.