Getting information on the form into the database.

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I am using "=Shipper.Column(1)" in the control source of a text box to
show the ShipperCode on a form.

How do I get this information also into the database?

thank you
Michael
 
If you want to retrieve the data, from another place, but the form it self
while the form is running then

' If the combo/list on the main form

Forms![MainFormName]!Shipper.Column(1)

' If the combo/list on the sub form

Forms![MainFormName]![SubFormName].Form!Shipper.Column(1)
 
I am using "=Shipper.Column(1)" in the control source of a text box to
show the ShipperCode on a form.

How do I get this information also into the database?

thank you
Michael

What's the Control Source of the combo box? Are you storing Column(0)
in your table? Might that be all that you need to do?

Generally you would not WANT to store data redundantly. If you can
always just join the Shipper combo box's table into a query to look up
this column, it should not be necessary to store this information in
any other table.

If it is necessary (say, to capture a value at a point in time, with
the intention that it should retain that value when the Shipper table
is edited), you can use the AfterUpdate event of the combo to "push"
it into a bound textbox:

Private Sub Shipper_AfterUpdate()
Me!ShipperCode = Me!Shipper.Column(1)
End Sub

John W. Vinson[MVP]
 
Thank you both, I guess I did not even think about pulling the code when I
need it instead of storing it.
Thank you
Michael
 
Back
Top