Results 1 to 2 of 2

Thread: Data1.Records Don't Update!!!

  1. #1
    Addicted Member
    Join Date
    Feb 01
    Posts
    217
    Anybody know why these records won't update? Here is my code. I know the variables are right and all the fields are also correct.

    Data1.DatabaseName = drive & "\" & folder & "\testdata.mdb"
    Data1.ReadOnly = False
    Data1.RecordSource = "tblTestData"

    Data1.Recordset.AddNew

    With Data1.Recordset
    .Fields("Title") = title
    .Fields("Observed:") = observed
    .Fields("DDI Reference No") = filecounter
    .Fields("Steps to Reproduce:") = newsteps
    .Fields("Tester") = tester
    .Fields("Script") = script
    .Fields("System") = system
    End With


    If Err Then
    MsgBox (Error): Exit Sub
    Else
    Data1.Recordset.Update
    End If

    If Err = 3022 Then
    n = title
    MsgBox "Duplicate Title: Bug already Submitted" _
    & n & ". Please Enter a New bug with a New Title"
    Exit Sub
    End If

    If Err Then MsgBox (Error)
    Data1.Recordset.MoveLast

  2. #2
    Hyperactive Member
    Join Date
    Oct 00
    Location
    Chesterfield, UK
    Posts
    298

    Try This

    If you haven't sorted it try this :-

    If Err Then
    MsgBox (Error): Exit Sub
    Else
    With data1.recordset

    .Edit
    .Update

    End If

    If you have please tell me

    Regards

    Matt

Posting Permissions

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