Linked field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a lookup field where when I choose it I want another field
to automatically fill in. I have created the following on update in the
lookup feild but it will not work. C_Part_1_code is the field looking for
the automatic fill in.
C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=ME!CODE")
Can someone please explain what I have done wrong. Thanks
 
If Division is numeric then try something like:
Me.C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=" & ME!CODE)
If Divsion is text, try:
Me.C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=""" & ME!CODE
& """")
 
Thanks Duane its not working; does it matter that [block] is a query? I
queried some information to combine it and want to look up the information in
the query, it works for the lookup portion but maybe I shouldn't be doing
this?

Duane Hookom said:
If Division is numeric then try something like:
Me.C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=" & ME!CODE)
If Divsion is text, try:
Me.C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=""" & ME!CODE
& """")

--
Duane Hookom
MS Access MVP



Arlene said:
I have a form with a lookup field where when I choose it I want another
field
to automatically fill in. I have created the following on update in the
lookup feild but it will not work. C_Part_1_code is the field looking for
the automatic fill in.
C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=ME!CODE")
Can someone please explain what I have done wrong. Thanks
 
"its not working" isn't very descriptive. It shouldn't make any difference
if BLOCK is a table or query as long as the query isn't a parameter query.

We can't help much since we don't know anything about your tables, fields,
queries, data types, records,...

--
Duane Hookom
MS Access MVP

Arlene said:
Thanks Duane its not working; does it matter that [block] is a query? I
queried some information to combine it and want to look up the information
in
the query, it works for the lookup portion but maybe I shouldn't be doing
this?

Duane Hookom said:
If Division is numeric then try something like:
Me.C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=" &
ME!CODE)
If Divsion is text, try:
Me.C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=""" &
ME!CODE
& """")

--
Duane Hookom
MS Access MVP



Arlene said:
I have a form with a lookup field where when I choose it I want another
field
to automatically fill in. I have created the following on update in
the
lookup feild but it will not work. C_Part_1_code is the field looking
for
the automatic fill in.
C_PART_1_CODE = DLookup("DIVISION", "[BLOCK]", "DIVISION=ME!CODE")
Can someone please explain what I have done wrong. Thanks
 

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

Back
Top