Run SQL?

kbreiss

Registered User.
Local time
Today, 17:15
Joined
Oct 1, 2002
Messages
228
I have a permissions table that "1" is inquire, "2" is update and "3" is delete in the "Permissions" field.

Not for sure how to do this, but thought it would be something like this as far as setting a variable for the users permissions



strMyPermissions = "Select permissions from Security where LoginID = Forms!frmFacility.txtUpdatedBy;"

What I'm trying to do is assign the permission indicator to strMyPermissions, but what seems to be happening is its assigning the whole SQL statement to strMyPermissions. Any suggestions?

Thanks in advance,
Kacy
________
Rhode Island Medical Marijuana Dispensaries
 
Last edited:
Code:
strMyPermissions = "SELECT permissions FROM Security WHERE LoginID = " &  Forms("frmFacility").txtUpdatedBy & ";"
 
Last edited:
Thanks for the reply!........I'm getting a "Syntax error" Any suggestions?

Thanks in advance,
Kacy
________
LovelyWendie99
 
Last edited:
Was an extra " - deleted it from the post above now.
 
Thanks......got the query to run, but I don't think I asked for what I'm really wanting. Now I have......

strMyPermissions = "Select permissions from Security where LoginID = kreiss"

That part seems to be working.......What I really wanted is to store the permissions field into strMyPermissions.

Am I making any sense?

Kacy
________
Depakote Lawsuites
 
Last edited:
kbreiss said:
Thanks......got the query to run, but I don't think I asked for what I'm really wanting. Now I have......

strMyPermissions = "Select permissions from Security where LoginID = kreiss"

That part seems to be working.......What I really wanted is to store the permissions field into strMyPermissions.

Okay, this is simpler than you think; all that's gone before is a waste of time:

Code:
strMyPermissions = Nz(DLookup("Permissions", "Security", "LogonID = """ & Forms("frmFacility").txtUpdatedBy & """"))
 
Great! Thanks a lot. Learned something new today.

kacy
________
VIPER
 
Last edited:

Users who are viewing this thread

Back
Top Bottom