How do I apply a field value to another field automatically?

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

Guest

I am trying to do something that seems real simple to me but I can not figure
out how it is done. All I want to do is make one field autopopulate from
another field. For instance, I have a list of ID numbers that have names
associated with them. How do I make the name show up after the ID number has
been entered?
 
Jesse

(in Access, tables have "fields", forms have "controls")

Access needs to know what to set the second control to, based on what's in
the first, after the first is updated.

You can use the AfterUpdate event of the first control and add a code
expression something like:

YourSecondControl = ?????

Now, how you get the value to add depends on how your first control gets its
value. If you are using a combo box, you can include the value as part of
the row source for the combo box and set the second control's value with
something like:

YourSecondControl = YourComboBox.Column(x)

where "x" is one less than the column in which that value shows up in your
row source (Access uses zero-based counting for this property).
 
Jeff,
Thank you for your help. Now that I know how to use the correct lingo,
controls vs. fields, my next question is this: What do I put in the
"afterupdate" box? Control #1 reads it's information from a query and the
values are numbers/ID's. I want the second control to read the name column
associated with the ID number on the same record. I hope this makes
sense....let me know and thank you for your help.

Jess
 
Back
Top