-----Original Message-----
Assuming that UserID is a text-formatted field in your table pswc, try this:
If IsNull(DLookup("UserID", "pswc", _
"[UserID]='" & [UserID] & "'")) = False Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
If it's a numeric-formatted field:
If IsNull(DLookup("UserID", "pswc", _
"[UserID]=" & [UserID])) = False Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
I probably would use the DCount function in this situation though, instead
of DLookup, as you know a specific value that you want to test for (again
assuming text-formatted field):
If DCount("*", "pswc", "[UserID]='" & [UserID] & "'")) > 0 Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
--
Ken Snell
<MS ACCESS MVP>
Hi Ken:
Thank you but is still giving me this message:
Application can't find the field '|' referred to in your
expression
Thaks,
Dan
-----Original Message-----
If IsNull(DLookup("[UserID]", "[pswc]", _
"[UserID]='" & [UserID] & "'")) = False Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
--
Ken Snell
<MS ACCESS MVP>
message
Hi:
What would be the syntax for a Dlookup to find a name
in a
table; if it finds it then open a form...this is not
working??
If (DLookup("[UserID]", "[pswc]", _
"[UserID]='" & [UserID] & "'")) Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
Thanks,
Dan
.
.