Results 1 to 4 of 4
  1. #1
    pwalter83 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2011
    Posts
    19

    VBA code for adding records to a table

    Hi,



    Does anyone know what code I need to add in the VB section to add new records to a table(thats exists in SQL) ?

    In other words, what needs to be included in this section:

    Private Sub Add_Record_Click()
    End Sub

    Thanks !
    Paul

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    What exactly does this mean
    thats exists in SQL
    ?

    The code you have shown is related to a button on a Form. Is this form bound to the Table you mentioned?

  3. #3
    pwalter83 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2011
    Posts
    19
    Quote Originally Posted by orange View Post
    What exactly does this mean
    ?

    The code you have shown is related to a button on a Form. Is this form bound to the Table you mentioned?
    Yes, the form is bound to a table(VESSEL) and when the button is clicked, all the values in the form need to be added to the existing VESSEL table. This tabe already exists in SSMS.

    It exists in Access through ODBC. Pls find the form attached, this would make it more clear.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I have access 2003 so can not read the accdb.

    Since the form is bound, what happens when you move to the "next" record?

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

Similar Threads

  1. execute code on subform without adding a record
    By markjkubicki in forum Forms
    Replies: 5
    Last Post: 10-13-2011, 12:23 PM
  2. adding records
    By jwallace203 in forum Forms
    Replies: 3
    Last Post: 07-18-2011, 10:00 PM
  3. Adding records to existing table
    By Mclaren in forum Programming
    Replies: 5
    Last Post: 05-18-2011, 12:44 PM
  4. Replies: 10
    Last Post: 01-10-2011, 07:52 PM
  5. Adding VB code on a embedded coding for a button
    By cwwaicw311 in forum Programming
    Replies: 1
    Last Post: 02-20-2010, 12:25 PM

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