DLOOKUP

G

Guest

I'm have some truble with the following (this is in "Form"):

DLookUp([“Expr12â€],[All Stations]![“STN CDâ€])= & forms( [All
Stations]![“Profit Centerâ€])

thanks
 
S

storrboy

I'm have some truble with the following (this is in "Form"):

DLookUp(["Expr12"],[All Stations]!["STN CD"])= & forms( [All
Stations]!["Profit Center"])

thanks


Have you even looked at how the DLookUp function is used?
DLookup(expr, domain[, criteria])

I'm having a hard time figuring which part of your example fits which
arguments, or if they are even all there.
 
G

Guest

Try:

=DLookUp("[FieldName]","[TableOrQueryName]","[STN CD])= " & Forms![All
Stations]![Profit Center])

where FieldName is the name of the field in the table or query
TableOrQueryName whose value you want returned where the value of the STN CD
field matches the value of the Profit Center control on the form All
Stations. If the STN CD field is a text data type rather than a number data
type you need to wrap the value in quotes:

=DLookUp("[FieldName]","[TableOrQueryName]","[STN CD])= """ & Forms![All
Stations]![Profit Center] & """")

Ken Sheridan
Stafford, England
 
G

Guest

Ok, I think I'm doing some thing wrong here. I tryied the follow but they did
not work. I get a pop up menu asking me to "enter paremeter value".

DLookUp("[FieldName]","[All Stations]","[STN CD])= """ & Forms![All
Stations]![Profit Center] & """")


DLookUp("[Expr12]","[All Stations]![STN CD])= """ & [Forms]![All
Stations]![Profit Center] & """")

So, [FieldName] is the field in my form? And [TableOrQueryName] is my "All
Stations" table?
Try:

=DLookUp("[FieldName]","[TableOrQueryName]","[STN CD])= " & Forms![All
Stations]![Profit Center])

where FieldName is the name of the field in the table or query
TableOrQueryName whose value you want returned where the value of the STN CD
field matches the value of the Profit Center control on the form All
Stations. If the STN CD field is a text data type rather than a number data
type you need to wrap the value in quotes:

=DLookUp("[FieldName]","[TableOrQueryName]","[STN CD])= """ & Forms![All
Stations]![Profit Center] & """")

Ken Sheridan
Stafford, England

pgarcia said:
I'm have some truble with the following (this is in "Form"):

DLookUp([“Expr12â€],[All Stations]![“STN CDâ€])= & forms( [All
Stations]![“Profit Centerâ€])

thanks
 
S

storrboy

Ok, I think I'm doing some thing wrong here. I tryied the follow but they did
not work. I get a pop up menu asking me to "enter paremeter value".

DLookUp("[FieldName]","[All Stations]","[STN CD])= """ & Forms![All
Stations]![Profit Center] & """")

DLookUp("[Expr12]","[All Stations]![STN CD])= """ & [Forms]![All
Stations]![Profit Center] & """")

So, [FieldName] is the field in my form? And [TableOrQueryName] is my "All
Stations" table?

Yes and No. [FieldName] is the field in the table that contains the
value you want to retrieve.
[TableOrQueryName] is the table or query that contains [FieldName].
There is also an extra bracket ) in there.
"[STN CD])= """ & Forms![All Stations]![Profit Center] & """")

Should probably read as

"[STN CD] = """ & Forms![All Stations]![Profit Center] & """")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top