Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add record with DISTINCT

    How does one call a DISTINCT query in a procedure?
    I have one already built.

    I'm building a new table from an existing one and I need to use the distinct qry to get each indexed listing of a field. Take that value, and add records. Then move to the next listing in the query and start over.

    I suppose I could create a table of those indexed values and set a one-to-many relationship, but I still don't know how to get those values into the procedure to run the script.

  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 record with DISTINCT

    You dim a recordset object variable and use the query as its record source. Then you navigate through the recordset and use each record's field values to do whatever it is you're doing. How you do it depends on whether you're using DAO or ADO, so I can't be more specific.
    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
  •