Dlookup won't work

Djblois

Registered User.
Local time
Today, 11:25
Joined
Jan 26, 2009
Messages
598
I am using this dlookup and it is not giving me any errors but it is returning nothing. Why won't it work?

Code:
DLookup("[Whse]", "tblWhse", "[WhseID] = " & Form_SubfrmAppts.cobCarrier.Value)

I know the value is there.
 
yes it is a subfrm. But I am not accessing it in the parent form. I am accessing it in code underneath itself.
 
Here is the full code. I changed it like you suggested in the code and I still am getting a blank.

Code:
Form_frmDelete.lblError.Caption = "Are you sure you want to delete Apptointment CW" & _
            Form_frmScheduled_Appts.tbConfirmation.Value & " With Carrier " & _
            DLookup("[Whse]", "tblWhse", "[WhseID] = " & Me!cobCarrier) & _
            " and remove all of it's associated Orders from WST?"
 
Is the control named "cobCarrier" really returning a value for WhseID? Those look incompatible (Carrier vs Whse). Can you post the db?
 
Please don't yell. I am a total idiot!! lol brain fart. I was just doing something with the warehouses - you are right I am looking in the wrong table. lol
 
I assume your command button is on the parent form. In this case it would be:

Me!Subform1.Form!ControlName
 
When you've made as many bonehead mistakes as I've made, you don't yell at others. :p

Glad you sorted it out.
 
When you've made as many bonehead mistakes as I've made,
Please tell me that they start coming at longer intervals. There are times I start to wonder if the frequency will start to decline for me. :)
 
Okay...they start coming at longer intervals.

It may not be the truth, but it is what you wanted to hear. :D
 

Users who are viewing this thread

Back
Top Bottom