Pass Unbound text data to a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kaybaj
    New Member
    • Jun 2010
    • 8

    #1

    Pass Unbound text data to a table

    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.
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    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:
    Code:
    Me.tb_LastChangeBy=Forms!frm_Login!cmb_User
    The userID will now be stored in the table.

    Comment

    • kaybaj
      New Member
      • Jun 2010
      • 8

      #3
      Thanks thesmileyone i'll give that a shot

      Comment

      • kaybaj
        New Member
        • Jun 2010
        • 8

        #4
        Hey thesmileyone, you're a genius cos you've put smile on ma face. Thanks for that been struggling with that for some time now and you just made my day, it worked really fine Thanks again

        Comment

        • TheSmileyCoder
          Recognized Expert Moderator Top Contributor
          • Dec 2009
          • 2322

          #5
          Im smiling to hear that!

          Welcome to Bytes

          Comment

          Working...