Query To A Table From A Form

D

DNguon

I'm want to create a form from a Query where there is one combo box and
several text boxes. Whatever I select in the Combo Box I want the
corresponding data to show up in text boxes. Then I want all of this data and
any other data I add on this form to shoot into a Table.

Can Anyone Help?
 
J

John Vinson

I'm want to create a form from a Query where there is one combo box and
several text boxes. Whatever I select in the Combo Box I want the
corresponding data to show up in text boxes. Then I want all of this data and
any other data I add on this form to shoot into a Table.

Can Anyone Help?

Well, I can suggest that No, You Really Don't want to do this.

Storing data redundantly from one table into another table is almost
NEVER a good idea.

What are these two tables? What are you trying to *accomplish* in the
real world? I'm sure there's a way to do it that does not involve
redundant data storage!

John W. Vinson[MVP]
 
D

DNguon

The data stored will not be redundant because the original data is coming
from a linked table.

Heres what I'm trying to accomplish:

I'm trying to create a form that has a combo box that shows all open jobs.
This data is coming from a linked table then goes into my query then into my
form. When the Line Lead selects the Open Job Number from the combo box I
want the corresponding data of that Job Number (from my query) to show up in
text boxes on my form. Then the Leads will enter in additional information
below. I would then like this data to shoot into a table.

Can You Help Or Suggest A Better Way To Do This.

Thanks
 
J

John Vinson

The data stored will not be redundant because the original data is coming
from a linked table.

Heres what I'm trying to accomplish:

I'm trying to create a form that has a combo box that shows all open jobs.
This data is coming from a linked table then goes into my query then into my
form. When the Line Lead selects the Open Job Number from the combo box I
want the corresponding data of that Job Number (from my query) to show up in
text boxes on my form. Then the Leads will enter in additional information
below. I would then like this data to shoot into a table.

Can You Help Or Suggest A Better Way To Do This.

Yes, I can. If the linked table is available routinely, store only the
Open Job Number in your table; and then use a Query linking it back to
the linked table to retrieve the personnel fields. That's how
relational databases are designed to work!

Is the "linked" table on a remote computer, or otherwise generally
unavailable? That would be the only reason to copy the data, and even
there you will have to work with great caution. Someone's information
could be corrected in the main table, and you would then have a copy
of the old, INCORRECT data in your table, with no easy way to detect
that fact.

If you must do this, you can "push" data from the combo into bound
textboxes in the combo's AfterUpdate event:

Private Sub comboboxname_AfterUpdate()
Me!txtLastName = Me!comboboxname.Column(1)
Me!txtFirstName = Me!comboboxname.Column(2)
....

Note that the column property is zero based, so (1) means the *second*
field in the combo's row source query.

John W. Vinson[MVP]
 
Top