I WANT TO USE DLOOKUP TO SHOW SOME DATA BUT WITH SOME CONDITIONS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I USED TO WORK WITH DLOOKUP WITH ONE CONDITION TO SHOW SOME DATA BUT I DO NOT
HAVE PROBLEM FOR THIS BUT I WANT TO SHOW SOME DATA WITH USING DLOOKUP WITH
THRE CONDITIONS FOR EXAMPLE:

Dim Show As Boolean
Show = DLookup("SSHOW", "UsersPermission", "[UserName] =
Forms![Main]![SUserName]" And [formName] = Me.formName)
If Show = False Then
MsgBox " You dot not have permission to run this form "
DoCmd.Close
SO WHEN I DO THIS FUNCTION I GOT ERROR BUT I DO NOT KNOW THE REASON SO I
NEED HELP
 
jehad hindi said:
I USED TO WORK WITH DLOOKUP WITH ONE CONDITION TO SHOW SOME DATA BUT I DO
NOT
HAVE PROBLEM FOR THIS BUT I WANT TO SHOW SOME DATA WITH USING DLOOKUP WITH
THRE CONDITIONS FOR EXAMPLE:

Dim Show As Boolean
Show = DLookup("SSHOW", "UsersPermission", "[UserName] =
Forms![Main]![SUserName]" And [formName] = Me.formName)
If Show = False Then
MsgBox " You dot not have permission to run this form "
DoCmd.Close
SO WHEN I DO THIS FUNCTION I GOT ERROR BUT I DO NOT KNOW THE REASON SO I
NEED HELP

Is UsersPermission the name of the table you're searching? According to
your DLookup, it should be. SSHOW, UserName and formName must be field
names in the UsersPermission table.

Try this:

Show = DLookup("SSHOW", "UsersPermission", "[UserName] = '" &
Forms![Main]![SUserName] & "' And [formName] = '" & Me.formName & "'")

Tom Lake
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top