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

    Initializing Date Field For Each Record In A Table (Accessb 2000)

    I am trying to create an Update query that will examine the record set in a table for each of the six date fields and if there is a date value I wan to 1.) copy those records to and history table and then I want to initialize all the date fields to empty date values, ready for new entry.

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

    Re: Initializing Date Field For Each Record In A Table (Accessb 2000)

    You wouldn't do it with a query, you would use a pair of recordset objects and loop through the records in the first. For each record that met the criteria (do you really have 6 date fields in a record?), you could the do an AddNew and copy the fields in the current record to the other recordset. After copying the record, you could clear the date field values of that record and then move on to the next record in the recordset. If you wrap all this in a transaction, you can roll the whole thing back if any of the steps fails.
    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
  •