Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jul 2001
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create New Record (Access 2000)

    I cant seem to create a new record in table from module.
    Table format as shown:
    ID - Autonumber
    CustomerID - integer
    Date

    Basically I have this:
    Dim dbCurrent As DAO.Database
    Dim rstDispatch As DAO.Recordset
    Set dbCurrent = CurrentDb
    Set rstDispatch = dbCurrent.OpenRecordset("tblDispatch")
    With rstDispatch
    .AddNew
    ![CustomerID] = 1
    ![Date] = Date
    .Close
    End With

    Can anyone tell me what I am missing.
    This does nothing to the table.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create New Record (Access 2000)

    I believe it is the Update command that you are missing, try:

    With rstDispatch
    .AddNew
    ![CustomerID] = 1
    ![Date] = Date
    .Update
    End With

    rstDispatch.Close

Posting Permissions

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