using dlookup to make a button visible.
FYI MSPContactUserID(same as Environ("username"))
table t41ContactMSP looks like this
Expand|Select|Wrap|Line Numbers
- MSPContactID(PK) MSPTitleID MSPContactUserID
- 1 1 smitha
- 2 3 smitha
- 3 1 jonesb
- 4 2 bakerc
- 5 2 smitha
Need to verify the Environ("username") has the same MSPContactID as the ContactPMgrID (ContactPMgrID is field on form) then verify that it is the correct MSPTitleID (1). How can I make it meet all criteria?
Here is the issue. it finds the first instance of the MSPContactUserID and stops there, it does not take into account that the MSPTitleID must me 1.
Expand|Select|Wrap|Line Numbers
- Me!fClosureApproval.Form.btnApprClose.Visible = DLookup("[MSPContactID]", "[t41ContactsMSP]", _
- "[MSPContactUserID] = '" & Environ("username") & "'") = Me.ContactPMgrID _
- & "' And [MSPTitleID] = '" & 1