post record to table

  • Thread starter Thread starter LGarcia
  • Start date Start date
L

LGarcia

Hi all,
I have a form with a combo box. When my user makes a selection from this
combo box, 3 other fiields on the form are populated with data directly
related to the combo box value. On this same form I have a text box where a
value can be entered. What I need is for all the values of this record to be
written to another table after users enter the value in the text box. Right
now only the combo box value is written. Not sure how to do this.
Hope someone can help!
Thanks,
LGarcia
 
Hi all,
I have a form with a combo box. When my user makes a selection from this
combo box, 3 other fiields on the form are populated with data directly
related to the combo box value. On this same form I have a text box where a
value can be entered. What I need is for all the values of this record to be
written to another table after users enter the value in the text box. Right
now only the combo box value is written. Not sure how to do this.
Hope someone can help!

Stop.

You're apparently attempting to copy three fields from one table (the
combo box's Rowsource table) to another table.

THIS IS A BAD IDEA.

The whole *point* of relational databases is to avoid redundancy,
thereby avoiding redundancy. Copying the data into your second table
is very rarely either necessary or a good idea. If you store the
unique link using the combo box, then you can use a Query, or a combo
box, or DLookUp, or any number of methods to link to the table where
the data resides and display it.
 
I agree. However this table is not meant to be part of my DB design.
Thanks for your reply.
 
I agree. However this table is not meant to be part of my DB design.
Thanks for your reply.

ok... what function DOES it serve? Why does this table exist at all?
If you want the data in it for a Form, a Report, an Export, pretty
much anything, you can just use a Select query.

I'll answer your question below... but this is still A Very Bad Idea
and almost certainly not necessary.
In the AfterUpdate event of the Combo Box, you can "push" the data
into bound controls on the form; the code would be something like

Private Sub combobox_AfterUpdate()
Me!txtThis = combobox.Column(1)
Me!txtThat = combobox.Column(2)
Me!txtTheOther = combobox.Column(3)
End Sub

The Column property is zero based so this will copy the second, third
and fourth fields in the Combo's Rowsource to the controls.
 
Back
Top