Aaaargh
Trying to get the customer onto my form using DLookup.
DLookup("Customer", "tblSales", "SalesOrderID = " & Forms![frmSales]!SalesOrderID)
Should return the "Customer" from "tblSales" where "SalesOrderID" from "tblSales" = "SalesOrderID" on the current form "frmFitting"
DLookup
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: DLookup
You say your current form is called frmFitting, but the expression refers to the form frmSales?
Maybe this: =DLookup("Customer", "tblSales", "SalesOrderID = " & Forms![frmFitting]!SalesOrderID)
Maybe this: =DLookup("Customer", "tblSales", "SalesOrderID = " & Forms![frmFitting]!SalesOrderID)
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- SilverLounger
- Posts: 1728
- Joined: 25 Jan 2010, 08:34
- Location: Stoke on Trent - Staffordshire - England
-
- 2StarLounger
- Posts: 164
- Joined: 10 Feb 2010, 12:53
Re: DLookup
Help please: I am struggling to get my DLookup working
Its parameters are Client name is the field I want returned, from the QueryAllClientnames2 where TRIndCode is in the query I am woking in equals the field Code in the query all clint names 2
=DLookUp("Client Name","QryAllClientNames2","TRIndCode =" [QryAllClientNames2]!
Its parameters are Client name is the field I want returned, from the QueryAllClientnames2 where TRIndCode is in the query I am woking in equals the field Code in the query all clint names 2
=DLookUp("Client Name","QryAllClientNames2","TRIndCode =" [QryAllClientNames2]!
Code: Select all
")
What have I got wrong please?
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: DLookup
If Code is a number field:
=DLookUp("Client Name","QryAllClientNames2","Code=" & [TRIndCode])
If Code is a text field:
=DLookUp("Client Name","QryAllClientNames2","Code=" & Chr(34) & [TRIndCode] & Chr(34))
Chr(34) is the double quote character ".
=DLookUp("Client Name","QryAllClientNames2","Code=" & [TRIndCode])
If Code is a text field:
=DLookUp("Client Name","QryAllClientNames2","Code=" & Chr(34) & [TRIndCode] & Chr(34))
Chr(34) is the double quote character ".
Best wishes,
Hans
Hans
-
- 2StarLounger
- Posts: 164
- Joined: 10 Feb 2010, 12:53
Re: DLookup
I regret that having pasted both of your lines of code into the expression builder that they don't work! :-( Any further thoughts please?
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 2StarLounger
- Posts: 164
- Joined: 10 Feb 2010, 12:53
Re: DLookup
Ok, thank you very much Hans.