Trying to Autoupdate Form Fields

  • Thread starter Thread starter halfbodyguy
  • Start date Start date
H

halfbodyguy

I think this is pretty simple. I want to have my form function so that
they i type the record value in the field of a primary key, all the
other fields update with the corresponding value, and everything should
be editable... I'm new, and Obviously missing something in my form
creation. Thanks
 
I think this is pretty simple. I want to have my form function so that
they i type the record value in the field of a primary key, all the
other fields update with the corresponding value, and everything should
be editable... I'm new, and Obviously missing something in my form
creation. Thanks

Well... one thing you're perhaps missing is that you should NOT store
data redundantly.

Are you trying to select a PK value and use it to copy all of the
fields from its table onto your form, in order to store them in
another table? If so, DON'T. That's not how relational databases work!
You should just store the ID and use a Query to link to it.

If I'm misunderstanding, please explain: what's the Rowsource of the
combo, the Recordsource of the form, and which record do you want to
update when?

John W. Vinson[MVP]
 
no, I am just meaning For example I want to type in a customer number,
and have other STATIC fields update, just so that the enterer knows
that they selected the right customer.

The updated fields would only be pulling information, not storing it,
because they would be on a lookup table.
 
no, I am just meaning For example I want to type in a customer number,
and have other STATIC fields update, just so that the enterer knows
that they selected the right customer.

The updated fields would only be pulling information, not storing it,
because they would be on a lookup table.

The simplest way to do this is to use a Combo Box instead of a
textbox. Create a Query based on the customer table; select the
customer number and all the other fields you want to see. Make the
Customer Number the bound column. The other colums should be included,
and the Column Count property should include them; you can make them
invisible by setting the Column Width property to zero if you wish.

Then put textboxes on the form with Control Source values such as

=comboboxname.Column(n)

using the actual name of your combo box; (n) is the *zero based*
subscript of the desired column in the combo's query, for instance
you'ld use Column(3) to display the address if the Address were the
fourth field in the query.

John W. Vinson[MVP]
 
Back
Top