Update field from Text box

jalverson

Registered User.
Local time
Today, 13:22
Joined
Oct 27, 2004
Messages
42
I have a form with two combo boxes, one for shipping point and one for destination point. I then use a text box to concatenate the 2 values together. All of this is working fine on the form. I now want to store this value in a freight table. I'm using the table as the controlsource for the form so I have tried the following code but it doesn't work.

Private Sub Text27_AfterUpdate()

Me.Route = Me.Text27.Column(0)

End Sub

Any thoughts or suggestions? Thanks for you response.

Jeff
 
The coding should be in the Combo Box "After Update" section.

eg:
-------------------------------------------------

Private Sub Combo#_AfterUpdate()

Me.Route = Me.Combo#.Column(0)

End Sub
------------------------------------------------------
 
Sounds like your running into a concurrent operations issue. Access concatonates the text from your two combo boxes and updates the Route field simultaneously, so the concatonated text isn't ready for the field when Access tries to move it. Try this instead:

Private Sub Text27_AfterUpdate()

Me.Route = Me.cboShipping & " " & Me.cboDestination

End Sub

You may need to add column parameters to the cboControls depending on how you built your combo boxes.
 
Thanks for the help. You are correct. I had the code on the wrong field. Once I moved the code to the combo box, the form now works as designed. Thanks, again, for your help.

Jeff
 

Users who are viewing this thread

Back
Top Bottom