i have a table for username and password, then a login form with a combo22(usernam e) and a textboxA(passwo rd), also i have another textboxB with =[Combo22].[column](1) as control source. when a user choose his username from the combo22, textboxB also get the value of that username i.e if the username is Steve, textboxB also display Steve, and when you click the command button the swithboard opens and the login form goes into hiding so that all the other forms continue to reference it and the username is displayed on the forms. now what i want to do is for this username on the forms to be saved in a table against every record entered by the user.
Pass Unbound text data to a table
Collapse
X
-
Simplest approach would be to add some code in the before update event of your form. Lets presume you have a field in your tables called: ID_ChangedBy which contains the ID of the last user to edit the record. You add this field to a textbox (Doesn't have to be visible) and call the textbox for tb_LastChangeBy .
In the beforeUpdate of the FORM, you then add code like this:
The userID will now be stored in the table.Code:Me.tb_LastChangeBy=Forms!frm_Login!cmb_User
-
Comment