Is it possible to have multiple conditions in the criteria field of a dLookup command? I want to autopopulate a value into a form if both pieces of critera are met.
The table I'm pulling the information from has the same person (UID) several times, but only one time per project number (Seqnum). I am entering the SeqNum and UID values into the form. I want to pull in the other information (Employee Role and RIS Funded Effort %) from that table.
Here's the code I'm working on. I need the Dlookups to be both [UID] & [Seqnum] ='"... but I'm just not understanding how.
Private Sub UID_AfterUpdate()
Dim strEmployeeRole As String
Dim strRISFundedEffort As String
strEmployeeRole = Nz(DLookup("[Employee Role]", "tbl_RISinfoPull", "[UID]='" & Me![UID] & "'"))
strRISFundedEffort = Nz(DLookup("[RIS Funded Effort %]", "tbl_RISinfoPull", "[Seqnum]='" & Me![SeqNum] & "'"))
Me.Employee_Role = strEmployeeRole
Me.UIRISFundedEffort = strRISFundedEffort
End Sub
Thanks for any assistance in helping me understand this.
The table I'm pulling the information from has the same person (UID) several times, but only one time per project number (Seqnum). I am entering the SeqNum and UID values into the form. I want to pull in the other information (Employee Role and RIS Funded Effort %) from that table.
Here's the code I'm working on. I need the Dlookups to be both [UID] & [Seqnum] ='"... but I'm just not understanding how.
Private Sub UID_AfterUpdate()
Dim strEmployeeRole As String
Dim strRISFundedEffort As String
strEmployeeRole = Nz(DLookup("[Employee Role]", "tbl_RISinfoPull", "[UID]='" & Me![UID] & "'"))
strRISFundedEffort = Nz(DLookup("[RIS Funded Effort %]", "tbl_RISinfoPull", "[Seqnum]='" & Me![SeqNum] & "'"))
Me.Employee_Role = strEmployeeRole
Me.UIRISFundedEffort = strRISFundedEffort
End Sub
Thanks for any assistance in helping me understand this.