Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get Dlookup to use a value from the combo box?

Status
Not open for further replies.

NeoZakz

Technical User
Jul 22, 2002
25
0
0
US
Im using this line here:

DLookup("[Miledate]", "Mile1", Me![Date Due] = Me![Govt])

And it wants me to enter an object for Me![Govt] so it looks like this Me![Govt] = "PPR1". Im trying to get the Dlookup to lookup the value thats in the combo box because theres a lot of different ones. Anyone know what to add to make it just grab whats in the box already and look it up?
 
Think 'runtime!'
replace this:
DLookup("[Miledate]", "Mile1", Me![Date Due] = Me![Govt])
with:
DLookup("[Miledate]", "Mile1", SQL)


Where sql = " Me![Date Due] = " & Me![Govt]


That way the me!{Govt] gets evaluated by what is in it not ITSELF.

rollie@bwsys.net
 
AHh yea good idea. Thats why I come here heh. Thanks alot.
 
Does the SQL work in a VB coded if statement? if so how do I get it to look in SQL from there. This is a form its going to/from as well.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top