dlookup help

MrBowder

New member
Local time
Today, 12:46
Joined
Feb 16, 2012
Messages
7
I have figured that dlookup is the way I need to go...

I have tried it dozens of ways, no luck, hopefully someone out there can tell me what I am missing.

Btbl
autoID...field1...field2...bcode...units...unitprice...field4

BCtbl
bcodes...price...desc

my subform (Charges) is linked to Btbl and I am trying dlookup to fill unitprice from price

can you write the dlookup as an expression?
in the form, bcode is a combobox, in the afterupdate i tried this...
unitprice = dlookup("[price]" , "BCtble" , "[bcode]=" & bcode)

i have also tried it as vba code.. no luck
i tried putting in a stop in the vba code to see if it is even running, it never stops, so i dont know why in the afterupdate isnt even kicking in.

i get no error, no ?name, no #error, just a blank field staring at me.

thanks
 
Howzit

Try this in your after update event procedure. I'm not sure if you had typos in your code but I used your table definition you specified

me.bcode refers to the name of the control on your form

Code:
unitprice = dlookup("[price]" , "BCtbl" , "[bcode]=" & me.bcode)
 
I am sorry it took so long to respond.. tried it.. no luck..

no error, no ?name or anything

if I cant get this simple thing to work.. ima gonna give up on access..
:confused:
 
Is the bcode Field defined as a Number Datatype?

If it's defined as a Text Datatype the correct syntax would be

Code:
unitprice = dlookup("[price]" , "BCtbl" , "[bcode] = '" &  me.bcode & "'")

Linq ;0)>
 
thanks, but no luck...

what does it mean that no errors pop up, no error code in the textbox, nothing

since i cant get this dlookup to work, i tried even assigning one textbox value to another one and couldnt get that to work either. i am so lost on what i am missing here. i would love to figure out the dlookup because it sounds like a great function to use.

if i uploaded my file would you look at it?
 
Howzit

Sorry I have been away on business. If you load your file I'll have a peek.
 

Users who are viewing this thread

Back
Top Bottom