Results 1 to 5 of 5
  1. #1
    Randy is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    Jun 2010
    Posts
    48

    INSERT INTO Help Needed

    CurrentDb.Execute "INSERT INTO Accountlist" & "(CustEmailAddress) VALUES ('CustomerEmail');" --- After Update Event.


    I am trying to update the Accountlist table field 'CustEmailAddress' with information entered into the field CustomerEmail on a form named Delivery.
    Any help will be greatly appreciated.

    Thank you,
    Randy

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Why doesn't it work, what happens - error message, wrong results, nothing?

    The concatenation is incorrect if CustomerEmail is a textbox on form.

    CurrentDb.Execute "INSERT INTO Accountlist (CustEmailAddress) VALUES ('" & Me.CustomerEmail & "');"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Randy is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    Jun 2010
    Posts
    48
    There wasn't any error message it just tabbed to the next control. I tried your code and it works perfectly, thank you. I do still have an issue though. On the form Delivery I use a combo box to lookup a record from the table Accountlist. I want to update the email address for the record in table Accountlist that is selected by the combo box on the form Delivery. On the form Delivery the CustID (from Accountlist) is in the TextBox CustomerID and the name of the table Accountlist field is CustID. I hope this isn't too confusing. Thank you for your help.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    That would be an UPDATE sql action.

    CurrentDb.Execute "UPDATE Accountlist SET CustEmailAddress='" & Me.CustomerEmail & "' WHERE CustID=" & Me.CustomerID
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Randy is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jun 2010
    Posts
    48
    Thank you so much June7... that is exactly what I needed.

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

Similar Threads

  1. INSERT query: insert new data only
    By drh in forum Access
    Replies: 2
    Last Post: 04-04-2014, 05:31 PM
  2. Help needed : Library catalogue in access format is needed
    By dealers in forum Sample Databases
    Replies: 3
    Last Post: 01-16-2014, 02:03 PM
  3. Help Needed
    By nur annie in forum Forms
    Replies: 2
    Last Post: 11-02-2012, 02:56 AM
  4. Help Needed
    By sdecaire in forum Access
    Replies: 2
    Last Post: 11-11-2011, 03:07 PM
  5. Help needed...
    By Pazz in forum Access
    Replies: 0
    Last Post: 11-02-2009, 06:59 PM

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