Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    11

    Unanswered: Saving to tables!

    Hi,
    My Application Users can enter name,address,Phone Number etc on a form.
    I have a tbl"users" which already stores existing users.
    How can i Transfer the info from the "new user login Form" to this Existing Users table?

  2. #2
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343
    Hi

    Well from the small amount of detail in the question I have to assume the the following answer will help

    Just use the foem wizrd and make a form that thereafter will be attached to the table "User" - then name the form just before save as "New User Entry"

    save the form and off you go - enter the new user


    Gareth

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    dim strSQL as string
    strSQL = "INSERT INTO tblUsers (firstName, lastName, phoneNo) VALUES ('" _
    & me.myFirstNameBox & "', '" _
    & me.myLastNameBox & "', '" _
    & me.myPhoneNoBox & "');"
    currentdb.execute strSQL

    running in the current form (perhaps in response to a SAVE button _Click) this code will stick info from the current form textboxes named myFirstNameBox, myLastNameBox, and myPhoneNoBox into a new record in tblUsers.

    you should probably add some sort of check to:
    -- ensure the "new" user is really NEW
    -- ensure the form has been filled in reasonably
    maybe also worry a little if ' or " are possible candidates for user input characters.

    above strSQL assumes that all your fields are text.
    for numbers: drop the ' and ' that surrounds the numeric textbox name
    for dates: replace the ' and ' that surrounds the date textbox name with # and #


    izy
    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •