Updating a table field using unbound text boxes

ozzy68

Registered User.
Local time
Yesterday, 18:15
Joined
Dec 19, 2011
Messages
28
Hello forum, I am running into a wall and desperately need assistance.

I have a form that contains a combo box (cboEmployeeName) that pulls data from a query and populates three text boxes (Work Area, Last Name, First Name), This part works fine. Because the text boxes are being populated by the Combo box, they are not bound to the record source tblTrainingSchedule). I need the info that is in the text boxes to populate the respective fields in the record source.

I tested by adding "=tblTrainingSchedule!WorkArea=[cboEmployeeName].Column(3)" (column 3 is the work area) to the "after update" control but it does not populate the data.

Am I missing something here?
 
Code:
Me.Recordset.WorkArea = Me.[cboEmployeeName].Column(3)
 
Thanks for the reply,
However, I'm not using record sets. cboEmployeeName has three additional columns (full name, last name (column 1), first name (column 2), and work area (column 3)) the full name is used to make it easy for the scheduler to choose an employee. The other three columns are used to populate three individual text boxes, it works fine up to this point. After populating the entire form, the only information that shows up in the record is the information that is in any combo box, list box, or text box that is bound to the record table (tblTrainingSchedule). The above info does not show up because cboEmployeeName and the three associated text boxes are not bound to the record table. I may be misunderstanding but how/where/why would I use "Me.Recordset.WorkArea=Me.[cboEmployeeName].Column(3)"?
 
The recordset in Me.Recordset.WorkArea is the form's recordset which is built automatically from the RecordSource. (BTW The expression can be shortened to Me.WorkArea and the defaults will take it to the form's recordset if there is no control with the name WorkArea.)

The expression I posted goes in the AfterUpdate event procedure of cboEmployeeName.
 
Thanks,
I figured that out earlier today, shortened it as you stated, and put the code in the after update control...works like a charm!
 

Users who are viewing this thread

Back
Top Bottom