Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add a new record and not overwrite the current one (Outlook 98, Acces 97)

    Not sure what I am doing wrong. I am trying to use this to basicly add a new record and not over write the one already there.

    'On error resume next
    Set Dbe = Application.CreateObject("DAO.DBEngine.35")
    If Err.Number <> 0 Then
    MsgBox Err.Description & "--- Some functions may not work correctly" _
    & Chr(13) & "Please make sure that DAO 3.5 is installed on this machine"
    Exit sub
    End If

    Set MyDB = Dbe.Workspaces(0).OpenDatabase("tabsproddatabaseed garremitsremit2.mdb")
    RequestNum = UserProperties.Find("a").Value
    Set Rst = MyDB.OpenRecordset("select * from remitinfo where a = " & RequestNum)

    If Rst.EOF = True And Rst.BOF = True Then
    Set Rst = MyDB.OpenRecordset("remitinfo")
    Rst.addnew
    Else
    Rst.edit
    End if
    Rst.update
    Rst.Close
    MyDB.Close
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Add a new record and not overwrite the current one (Outlook 98, Acces

    Exactly what kind of error are you getting? Access 97 didn't like acting as an automation server, and you aren't showing any of your declarations, so it's pretty hard to guess at the problems.
    Charlotte

Posting Permissions

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