Auto filling of a filed on table

G

Guest

This may seem very easy for most users, but it is giving me a huge headache.
I have a table (named table 2) which one of the fields looks up its value on
another table (table 1) with a combobox. Table 1 has to columns (column 1 and
column 2). The combobox uses the values from column 1. I want to
automatically fill a separate field on table 2 with the value of column 2
based on the value I selected on the combobox (which, in turn, comes from
column1).

I really apreciate any help
 
A

Al Campagna

Hamilton,
Add Column2 to the combo where you select Column1. Using the AfterUpdate event of that
combo, set the value of your Coulmn2 bound text control on the current form....
Private Sub cboYourCombo_AfterUpdate()
YourFormsCol2Field = cboYourCombo.Column(1)
End sub
(combos are numbered 0,1,2,3,4, etc...)

However, If Column1 and Column2 in your combo lookup table never change, then you don't
have to "capture" Column2 to your form field... just "display" it.
= cboYourCombo.Column(1)
Since you have Column1 "captured", you can always re-relate it to the Column2 value in
your table... via it's association to Column1.
If a Column2 value assoviated with a Column1 value will EVER change, then capture its
as above...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."
 
G

Guest

I am attempting the same thing. I have a form based on the table Repack Box
Detail. I am entering the items being returned from a season (fireworks).
One of my fields in the form is Item Description. I want the field Internal
Item No. to automatically update based on the prodcut select in Item
Description. I have tried your suggestion and Me.InternalItemNo =
Me.ItemDescription.Column(2) in the AfterUpdate property, but nothing happens.

Any suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top