field autofill based on another field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box that lists names of queries. Based on this combo box, I
would like a text box to give me it's corresponding code. ie: query name is
"number of buys" the text box should have a 1 in it. I have about 31 query
names and corresponding numerical values.
Thanks for any help you can provide.
 
What "corresponding code"?

Are you saying you have a table that contains two fields, one of them a
"query name" and one a "corresponding code"?

In a form, you can add something like the following in the AfterUpdate event
of a combo box:

Me!MyTextBox = Me!MyComboBox.Column(x)

where "x" is the zero-based column number for the fields that comprise the
row source for your combo box. Zero-based means you start counting with
"0"...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I think my question was posed wrong. I ended up using an If, Then statement
to get the field to behave the way I wanted it to.
ie: If Me.Query_Type = "Query Name" Then Me.Query_ID = "1"
Thank you so much for your effort, my question was very poorly worded.
-J
 
Back
Top