Results 1 to 4 of 4
  1. #1
    markyboy is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2011
    Posts
    4

    Question Form to table help

    Ok i have a registration form which has the following text boxes
    Firstname
    Lastname
    Username

    The username text box is generated by this VB code which is entered in the "got focus" part of a CMD button. The command button was set up using the window which pops up when you first put it on the form and i used "add new record" option
    I then want what is typed in these text boxes to go to the table of records

    this is the VB used to generate the username
    Me.Username = Left(Me.Firstname, 3) + Left(Me.Lastname, 1) + Str(DMax("right(Username, 3)", "table") + 1)


    My question is that when i click the button it generates the username but then doesn't add it to the table


    Does anyone know any reasons why this would happen or suggestions of how i could make it better bare in mind this has to be done in an exam so please no long VB code thanks you

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    For that to occur without code, the form would have to be bound to the table (record source) and the textbox would have to be bound to a field in that table (control source). Are they?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    markyboy is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    May 2011
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    For that to occur without code, the form would have to be bound to the table (record source) and the textbox would have to be bound to a field in that table (control source). Are they?
    I hadn't but i have now and it works
    Thank you so much

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    No problemo!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 07-24-2012, 07:50 PM
  2. Replies: 9
    Last Post: 02-15-2011, 03:05 PM
  3. Replies: 2
    Last Post: 12-22-2010, 01:46 PM
  4. Replies: 1
    Last Post: 03-08-2010, 02:32 AM
  5. Replies: 0
    Last Post: 02-24-2010, 12:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums