Dlookup code need help

eholtman

Registered User.
Local time
Today, 16:23
Joined
Oct 12, 2004
Messages
54
Any help will appreciated.

Table tblAll

Country
City
Cost
Cost2

Inside Form have pull down.

cboCountry
cboCity


Then automate Cost into field
txtItemDesc
and Cost2 into Field
txtItemDesc

Code:

Private Sub cboCity_AfterUpdate()
Me.txtItemDesc = DLookup("[Cost]", "tblAll", "[City] ='" & _
[Forms]![frmlAdditions]![cboCity] & "'")
Me.txtItemDesc2 = DLookup("[Cost2]", "tblAll", "[City] ='" & _
[Forms]![frmlAdditions]![cboCity] & "'")

End Sub

Problem is that in my tblAll I have repeating items in Country and City with in the fields therefore with cboCity code. It only will produce the cost for the first time in the City field.

What I need is for this on cboCity after update if Country and City than cost.

Hope I have list enought to make sense.
_________________


Neither are working. I need this done by tonight for a project. So any help please. Last thing.
 

Attachments

E,

We get real confused reading the same post in multiple places. Let's defer
this to the thread in the General Forum ... OK?

Wayne
 

Users who are viewing this thread

Back
Top Bottom