Clicking a button will prefill some information in a field

M

MimiSD

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?
 
J

John Vinson

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]
 
M

MimiSD

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]
 

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