Re: Help with Dlookup with 3 criteria
Let me ask again.
User enters data into subfrm_Verified and you want to run DLookup to see if there is a match in Query3?
I just discovered that RefNos in that query is just a formatted version of SrNo which is a calculated value returned by a function. I think something you said earlier just sunk in. This is why RefNos in Table3 has no values.
Okay, if you want to do DLookup on query, then modify DLookup to reference the query instead of table.
Put code in form BeforeUpdate event.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Not IsNull(DLookup("OutwardDate", "Query3", "RefNos='" & Me.Ref_Nos & "' AND BranchName='" & Me.Branch_Name & "' AND AccountNos='" & Me.Account_Nos & "'")) Then
Me.Status = "Match"
Cancel = True
MsgBox "No Match"
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Last edited by June7; 09-15-2019 at 11:18 PM.