Lookup table

millers92

Registered User.
Local time
Today, 05:40
Joined
Feb 5, 2003
Messages
15
Hello all! I believe this is a simple one. I have a combo box that has a list of values(drop point names). Depending on the user's choice, I would like to have it display the corresponding drop number in another field on the same form. I have two tables (tblforecast & tbldropnumbers) that are linked via the Droppoint fields in both.

I'm not sure how I would go about "Auto-populating" this field when the Drop point name is selected.

Any help would be greatly appreciated.

Thanks

Steve
 
Steve,

Your source for the combo box (cboDropPoint) should be:

Code:
Select DropPointNumber, DropPointName
From   tblforecast
Order by DropPointName

It will be all on one line though.

Its properties will be:
columns = 2
bound column = 1
column widths = 0";1"
control source = DropPointName

In the AfterUpdate event of the combo put:

Me.DropPointNumber = Me.cboDropPoint.Column(0)

That is the first column, and it is invisible 0" wide.

Wayne
 
WayneRyan,

Ok....I see what you are saying to do, but I am not sure if this will acheive what I am attempting to do. Although I could be completely wrong. Let me explain a little further at what I am attempting:

I have two tables currently. One is named tblForcast while the other is named tblDropNumbers. Both tables have a field named DropPointName, but only the tblDropPointNumbers table has the DropNumber field. I have a form that has a combo box that the user will choose which drop point they need. Once they have done this, I would like to have another seperate text box (or combo, whatever would work best) on the form that would automatically be populated with the Drop Point Number that would be pulled from the tblDropPointNumber table. So, in essence it would evaluate what the user chose in the Drop Point name combo box and then go and do a lookup against the tblDropPointNumber table and populate the second text box on the form with the Drop Point Number.

Again, maybe I misunderstood your message, but I just wanted to clarify what I am trying to do as I may not have explained throughly the first time.

Would the procedure you posted earlier accomplish this?

Thanks for your help!

Steve
 
Steve,

The SQL in my last post will work, just change the table name to
tblDropPointNumbers.

Wayne
 

Users who are viewing this thread

Back
Top Bottom