Clicking a button will prefill some information in a field

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

Guest

What i would ultimately like to happen is that by clicking a button with like
a person's name on it that name will get prefilled onto all of the forms they
complete so that it can easily be identified who complete that form. Is this
possible? If so how?
 
What i would ultimately like to happen is that by clicking a button with like
a person's name on it that name will get prefilled onto all of the forms they
complete so that it can easily be identified who complete that form. Is this
possible? If so how?

It's simpler than that: no code and no button at all!

Include all of the fields you want to see in the Combo's RowSource
query, and set the ColumnCount property of the combo to include them
all. You can use the ColumnWidths property of the combo to set the
width of all the "extra" fields to 0.

On the Form, you can then put textboxes with Control Source property

=comboboxname.Column(n)

where n is the *zero based* position of the field you want to display
- e.g. if the PhoneNumber field is the sixth column in the combo's row
source query use Column(5).

John W. Vinson[MVP]
 
Thanks That worked great

John Vinson said:
It's simpler than that: no code and no button at all!

Include all of the fields you want to see in the Combo's RowSource
query, and set the ColumnCount property of the combo to include them
all. You can use the ColumnWidths property of the combo to set the
width of all the "extra" fields to 0.

On the Form, you can then put textboxes with Control Source property

=comboboxname.Column(n)

where n is the *zero based* position of the field you want to display
- e.g. if the PhoneNumber field is the sixth column in the combo's row
source query use Column(5).

John W. Vinson[MVP]
 
Back
Top