Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2013
    Posts
    2

    Unanswered: Help . Openrecordset running without errors but not adding records to table

    Hi,

    I'm struggling with the below code. It runs fine, no errors. But it simply doesn't add the record to the table. Its a copy of an existing process that works fine, but when i try the newer code it doesn't work or give any indication why.

    The table 'Test' only has single column 'Test', nothing difficult there. I'm using MS Access 2010 32-bit

    Dim dbSynergy As Database
    Dim rsData As Recordset
    Dim rsExist As Recordset


    Sub runsolo()

    Set dbSynergy = CurrentDb()

    'new section now
    'Set dbSynergy = CurrentDb()
    Set rsData = dbSynergy.OpenRecordset("test", dbOpenTable, dbAppendOnly)

    'save the values to the table
    With rsData
    .AddNew
    .Fields("Test") = 1234
    End With

    rsData.Close
    Set rsData = Nothing
    End Sub

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you are missing the update method after the columns are populated
    AddNew Method*[Access 2007 Developer Reference]

    'save the values to the table
    With rsData
    .AddNew
    .Fields("Test") = 1234
    .update
    End With
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2013
    Posts
    2
    yup, that'll do it!

Posting Permissions

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