ivonsurf123
Registered User.
- Local time
- Today, 09:44
- Joined
- Dec 8, 2017
- Messages
- 69
Hello,
I had this code in different buttons to search record on each table and when does not exist to add the new records on each tables using forms
How can I search two tables at the same time with one single button instead of two button for each table?
Table: tbl_CDS_DRA_Key_Legend
sExists = Nz(DLookup("[ExtractType]", "tbl_CDS_DRA_Key_Legend", "[KeyType]='" & Me.txtART & "' AND [ExtractType]='" & Me.txtExtractType & "' AND [Prefix]='" & Me.txtPrefix & "'"))
Table:tbl_CDS_DRA_Key_Master_Codes
sExist = Nz(DLookup("[Vendor]", "tbl_CDS_DRA_Key_Master_Codes", "[Vendor]='" & Me.txtExtractType & "' AND
I had this code in different buttons to search record on each table and when does not exist to add the new records on each tables using forms
How can I search two tables at the same time with one single button instead of two button for each table?
Table: tbl_CDS_DRA_Key_Legend
sExists = Nz(DLookup("[ExtractType]", "tbl_CDS_DRA_Key_Legend", "[KeyType]='" & Me.txtART & "' AND [ExtractType]='" & Me.txtExtractType & "' AND [Prefix]='" & Me.txtPrefix & "'"))
Table:tbl_CDS_DRA_Key_Master_Codes
sExist = Nz(DLookup("[Vendor]", "tbl_CDS_DRA_Key_Master_Codes", "[Vendor]='" & Me.txtExtractType & "' AND
Code:
='" & Me.txtCode & "'"))
I was trying to combine but it gave me an error:
sExists = Nz(DLookup("[Vendor]", "tbl_CDS_DRA_Key_Master_Codes", "[Code] = " & DLookup("[Code]", "tbl_CDS_DRA_Key_Legend", "[Code]='" & Me.txtCode & "' And [KeyType]='" & Me.txtART & "' AND [ExtractType]='" & Me.txtExtractType & "' AND [Prefix]='" & Me.txtPrefix & "' AND [Vendor]='" & Me.txtExtractType & "'")))
Please help, thank you:banghead: