Dlookup with multiple criteria??

D

deb

access2003

How can I make the textbox field"PassedQGDt" on form f015KeyMilestones"
enabled if MSPContactUserID=Environ("username") and the MSPTitleID=8 (number)

Check the Environ("username") against the MSPContactUserID and the
MSPTitleID=8

The user can have many MSPTitleID's ( it is a role table) and user can have
many roles, so it must search the table for both criteria and not just the
first MSPContactUserID .

Table is "t41ContactsMSP" (PK-MSPContactID number). Table set up like...

MSPContactID.............MSPTitleID.............MSPContactUserI
1.......................................1................................abcab
2.......................................1................................defde
3.......................................8................................abcabc


Your help us very appreciated!!!
 
D

Dirk Goldgar

deb said:
access2003

How can I make the textbox field"PassedQGDt" on form f015KeyMilestones"
enabled if MSPContactUserID=Environ("username") and the MSPTitleID=8
(number)

Check the Environ("username") against the MSPContactUserID and the
MSPTitleID=8

The user can have many MSPTitleID's ( it is a role table) and user can
have
many roles, so it must search the table for both criteria and not just the
first MSPContactUserID .

Table is "t41ContactsMSP" (PK-MSPContactID number). Table set up like...

MSPContactID.............MSPTitleID.............MSPContactUserID
1.......................................1................................abcabc
2.......................................1................................defdef
3.......................................8................................abcabc


Your help us very appreciated!!!


If I've understood you correctly, this would do it:

Me.PassedQGDt.Enabled = _
Not IsNull( _
DLookup( _
"MSPContactID", _
"t41ContactsMSP", _
"MSPTitleID=8 And MSPContactUserID=""" & _
Environ("username") & """" _
) _
)
 

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

Top