Autofill Field Not Displayed in Table

B

Bruister

I have a database in which a form contains a combo box with part numbers fom
a table. 2 further text boxes are autofilled by this formula (=[ComboBox1].
[Column](1)) and everything works fine on report. My problem is the
autofilled fields are blank in the associated table. How do I get these
fields to display in a table or query? Sorry if this is a dumb question but I
have come a long way with no programming in this database and am not skilled
in this. Hopping the answer is simple! Thanks
 
A

Al Campagna

Bruister,
Let's call the two text controls Item1 and Item2.
Add Item1 and Item2 fields to the table/query behind your form.
Place those new fields on your form, and bind them to Item1 and Item2
respectively.
The RecordSource for Item1 is Item1... (not the calculation)
and Item2 RecordSource is Item2... (not the calculation)
Using the AfterUpdate event of cboYourCombo to...

Private Sub cboYourCombo_AfterUpdate()
Item1 = cboYourCombo.Column(1)
Item2 = cboYourCombo.Column(2)
End Sub
(combo columns are numbered 0, 1, 2, 3, etc...)

This will store the two values in the appropriate fields in your table,
whenever cboYourCombo changes.

A calculated field (that you have now) is not "bound" to any table
field, so no values gets stored... only "displayed."

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

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

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