Access 2000 - filling multiple fields from combo selection

J

JoanneMB

I'm attempting to fill several fields on a form based on the selection from a
combo box. I've looked at the sample database that comes with the
application, but it isn't quite what I'm looking for.

Here's an example of what I'm trying to two.

Say we have three fields on a form, FieldA (combo box), FieldB (text) and
FieldC (text). When I drop down the combo box, I select "1" for FieldA. I
would like FieldB and FieldC to then become the other values from within the
combo box, say "2" and "3".

I've tried several different ways to accomplish this with code, but have yet
to succeed. I haven't coded within Access for years and am more than a tad
bit rusty.

HELP!

Thanks.
 
D

Douglas J Steele

In the AfterUpdate event of the combo box, put code along the lines of the
following:

Private Sub FieldA_AfterUpdate()

Me.FieldB = Me.FieldA.Column(1)
Me.FieldC = Me.FieldA.Column(2)

End Sub
 
J

JoanneMB

Thank you!

Your answer works great.

Douglas J Steele said:
In the AfterUpdate event of the combo box, put code along the lines of the
following:

Private Sub FieldA_AfterUpdate()

Me.FieldB = Me.FieldA.Column(1)
Me.FieldC = Me.FieldA.Column(2)

End Sub
 

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