Auto populate text boxes

  • Thread starter Thread starter Brad Reichert
  • Start date Start date
B

Brad Reichert

I've got a form with multiple text boxes and a combo box. All boxes
reference the same table. When an item is selected in the combo box, I'd
like the corresponding data to be automatically populated in the text boxes.
How is that done?

Thanks,

Brad
 
Hi,
If you build your combo with the wizard, it will write the code for you.
Just select the 'I want to find a record on my form based on the value .....
Can't remember the exact wording but it's on the first wizard dialog.
 
I don't wan the combo box based on the text boxes. I want the text boxes
based on the value selected in the combo box.

Brad
 
Like I said, use the wizard and it will do it for you.
Your text boxes will be populated based on your choice
in the combo.
 
I tried that, but I don't understand how using the combo box wizard allows
me to effect what is in the text boxes. I was able to effect what was in
the combo box based on another combo box but that was it.

Brad
 
Well, lets make sure we're talking about the same thing here.

You have a bound form, right?
On that form you use the wizard to insert a combo box.
On the very first screen the wizard brings up, choose:

"Find a record on my form based on the value I selected in my
combo box"

Follow the next steps and you'll have a combo box that will populate
your bound form with the record that corresponds to what you selected
in your combo.
 
Dan Artuso said:
Well, lets make sure we're talking about the same thing here.

You have a bound form, right?
I'm not sure what that means....I'm a newbie.
On that form you use the wizard to insert a combo box. Yes
On the very first screen the wizard brings up, choose:
"Find a record on my form based on the value I selected in my
combo box"
No, the first option is "I want the combo box to look up the value in a
table or query" The second option is "I will type in the values I want."
I must have something wrong. Any ideas?

Thanks,

Brad
 
Hi,
It sounds like your form is unbound. In other words, there is no
Record Source for the form. Is that the way you want it?

If not, select a table or query as the form's record source, then
select the appropriate fields for your control's 'control source',
then the wizard will give you that 3rd choice.

If you do want an unbound form, it will involve writing some code.
 
I don't see where to set that at.

Brad

Dan Artuso said:
Hi,
It sounds like your form is unbound. In other words, there is no
Record Source for the form. Is that the way you want it?

If not, select a table or query as the form's record source, then
select the appropriate fields for your control's 'control source',
then the wizard will give you that 3rd choice.

If you do want an unbound form, it will involve writing some code.
 
How do I do that?

Thanks,

Brad


select a table or query as the form's record source, then
select the appropriate fields for your control's 'control source',
then the wizard will give you that 3rd choice
 
Ok, I figured out how to bind the form but it's not working like I'd like it
to. Here is my setup.

I have a table (PC) for inventory with serial number, model number, CPU,
memory, etc.
I have a table (PC Models) with default specs for each model: CPU, Memory,
etc.

My form has text boxes that are link to the PC table but I'd like it to pull
the default values from the PC Models table when a model number is entered.
When I bind the form to the PC models table it changes all of my fields to
that table. If I bind it to the PC table it doesn't lookup the models from
the PC Models table.

Does that make sense? How can I have it do what I want?

Thanks,

Brad
 
Hi,
You make a query with both tables, joining on the model number(?)
and bind your form to the query. Then select the appropriate control
source for your text boxes.

I'm not exactly sure about your table setup as you seem to be storing
the same data in two tables.
 
Back
Top