Very Simple DLOOKUP Question

dvent

Registered User.
Local time
Today, 19:47
Joined
Jul 14, 2009
Messages
40
Hi All,

I've said this is a very simple question because I'm guessing for 99% of you it is.

I have not used DLOOKUP before but know VLOOKUP from excel.

I have a table containing Codes with numbers next to them. We'll call this TableCodes.

Codes Numbers
A1 1
B1 27
C1 36

I have a form with a combo box that looks up the codes from this table fine. I then have a textbox that I want to use DLOOKUP in to pull back the corresponding number from the table. I cannot work this out :(

Any help appreciated.

Dvent
 
not sure if this is much for help, but this is what i do.
Code:
=DLookUp("[I][U][location of value][/U][/I]","[I][U]main table of the value[/U][/I]","[I][U]location of criteria[/U][/I]=" & [I][U]the criteria to check against the other[/U][/I])

I hope this makes sense, but this is how I think about it. Just replace the italicized text and you've got it.
 
Last edited:
I have not used DLOOKUP before but know VLOOKUP from excel.
Forget anything you think you know and think can apply from excel, abso-frigging-useless ! (sorry)

I have a table containing Codes with numbers next to them. We'll call this TableCodes.

Codes Numbers
A1 1
B1 27
C1 36

I have a form with a combo box that looks up the codes from this table fine. I then have a textbox that I want to use DLOOKUP in to pull back the corresponding number from the table. I cannot work this out :(

Any help appreciated.

Dvent

OK Well D...anything should be used sparingly and far between, like here (and in many other cases) there is a much better way to do it...

have your combo use 2 columns (possibly hide the second)
Then use Me.YourCombobox.Columns(1) to retreive the hidden value and put it into a textbox...

The combobox is a "zero-based-array" which means that column 0 is the first column, hence the Columns(1), to retrieve the second one.

Good luck ! And remember to forget excel !
 

Users who are viewing this thread

Back
Top Bottom