Blackelise
aka Andrew
- Local time
- Today, 18:42
- Joined
- Jun 13, 2012
- Messages
- 35
Hi again,
I have the following code:
I think that it's very poor as there are repeated lookups not to mention the possible hit on system resourses.
I'm having to do this as I need to reference two different names and addresses on the one form so can't do it through the Form record Source...
It there a better/faster way of accessing this info from the table? I'm thinking of being able to read the record in and pick from it via code.
Thans in advance.
I have the following code:
PHP:
CustAddr1 = DLookup("[InvTo_Add1]", "tblCustAddress", "[InvTo_ID] =" & [EstOrd_CustName])
CustAddr2 = DLookup("[InvTo_Add2]", "tblCustAddress", "[InvTo_ID] =" & [EstOrd_CustName])
CustAddr3 = DLookup("[InvTo_Add3]", "tblCustAddress", "[InvTo_ID] =" & [EstOrd_CustName])
CustAddr4 = DLookup("[InvTo_Add4]", "tblCustAddress", "[InvTo_ID] =" & [EstOrd_CustName])
CustAddrPC = DLookup("[InvTo_PostCode]", "tblCustAddress", "[InvTo_ID] =" & [EstOrd_CustName])
CustAddrEmail = DLookup("[InvTo_email]", "tblCustAddress", "[InvTo_ID] =" & [EstOrd_CustName])
CustAddrTel = DLookup("[InvTo_Tel]", "tblCustAddress", "[InvTo_ID] =" & [EstOrd_CustName])
PTerms = DLookup("[InvTo_PayTerms]", "tblCustAddress", "[InvTo_ID] =" & [EstOrd_CustName])
I think that it's very poor as there are repeated lookups not to mention the possible hit on system resourses.
I'm having to do this as I need to reference two different names and addresses on the one form so can't do it through the Form record Source...
It there a better/faster way of accessing this info from the table? I'm thinking of being able to read the record in and pick from it via code.
Thans in advance.