J
johnlute
Access 2003
I posted this at the tail end of an earlier thread but since it's
about a very different issue I thought it made sense to post it here.
I've tossed in a DLookup into the following:
If fOSUserName = DLookup("txtUserName", "tblUserNames") Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Sorry! You are not allowed to use this form.",
vbCritical, vbOKOnly
DoCmd.CancelEvent
End If
This won't work UNLESS the table being looked up only has ONE user
name recorded. If I add more than one user name to the table then I
get the "not allowed" error message.
This isn't what I expect from DLookup - or am I way off base...?
Thanks!
I posted this at the tail end of an earlier thread but since it's
about a very different issue I thought it made sense to post it here.
I've tossed in a DLookup into the following:
If fOSUserName = DLookup("txtUserName", "tblUserNames") Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Sorry! You are not allowed to use this form.",
vbCritical, vbOKOnly
DoCmd.CancelEvent
End If
This won't work UNLESS the table being looked up only has ONE user
name recorded. If I add more than one user name to the table then I
get the "not allowed" error message.
This isn't what I expect from DLookup - or am I way off base...?
Thanks!