Dlookup - I am going to cry

abbaddon223

Registered User.
Local time
Yesterday, 20:50
Joined
Mar 13, 2010
Messages
162
Hi,

I'm hoping someone can help me before I kill myself or someone else :banghead:

I'm trying to get a Dlookup going, so:

I have a table: "Lookup_Outcomes". This has two fields: [Last_Outcome] and [Complete]

The other table is Tb_Master where my main data goes. There are two fields in this:

[Last_Outcome] which gets its value from the "Lookup_Outcomes"!"Last_Outcome" and [Complete]

I also have a form called "Frm_Contact_1" upon which is a combo box [Last_Outcome] from "Lookup_Outcomes"!"Last_Outcome"

There is also another field on the form called "Complete" from Tb_Master

What I would like to happen is when I select a value from the combo box "Last_Outcome" - an Afterupdate query runs which check the outcome selected in the "Last_Outcome" combo box, matches this to whether the outcome is complete, and stores that value in the field "Complete"

Data Example of Lookup_Outcomes (note the first line are headers)

[Last_Outcome] [Complete]
Answer Machine Incomplete
Not Interested Complete

The closest I can get is

[Forms]![Frm_Contact_1]![Complete].Value = DLookup("Complete", "Lookup_Outcomes", "Outcome=" & Last_Outcome)

Which errors

Can anyone help please?
 
try this - your last outcome field is a text - so you need to enclose your WHERE argument in single quotes:

Forms]![Frm_Contact_1]![Complete].Value = DLookup("Complete", "Lookup_Outcomes", "Outcome='" & Last_Outcome & "'")
 
Sir - you have save the lives of my colleagues today - thank you from all of us.

Seriously - thanks so much mate that's worked a treat!!!!!!
 

Users who are viewing this thread

Back
Top Bottom