Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update a parameter query? (97)

    Update a parameter query?
    I

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Update a parameter query? (97)

    If I understand you correctly, you are using a parameter query on an existing table that provides you with a subset of data from the existing table. You then want to update the recordset based on these results.

    How is the parameter query launched?

    I typically do the following to accomplish what you are trying to do:

    - Create a table, say Table1, that will hold the results of the new recordset after the parameter query is run.
    - Launch the parameter query via a command button on a form.
    - In the events feature of the command button, delete all data from the table that will store the data each time the command is executed.
    - Change the parameter query to an append query and append the fields to the table each time it is run. Launch the parameter query from the Command button after the delete statement.

    You can then run additional queries against Table1. Each time you execute the command, the Table1 will hold the new recordset.

    What is good about doing the update this way is that the data in your original table is never modified, just queried while Table1 changes each time you execute the query.

    Good Luck
    Regards,

    Gary
    (It's been a while!)

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

    Re: Update a parameter query? (97)

    You shouldn't try to do it the way you appear to be considering. All the parameter query does is present a filtered recordset. Just build your update query using the same parameters, and it will apply the update to the same records.
    Charlotte

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Update a parameter query? (97)

    Perhaps I misinterpreted the question. I read your response and need to digest it a bit. Are you saying to modify the parameter query to also act as an update query. If the parameter query is based on a table, wouldn't the dataset in the table be modified after the query is run? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>
    Regards,

    Gary
    (It's been a while!)

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

    Re: Update a parameter query? (97)

    Updating a query, as opposed to the table on which it's based can be done, but it is not as clean or as certain as simply updating the table using the same criteria you would have used for the select query. If the query happens to be multi-table, you'll also have problems updating it in Access 2000, even if it works in Access 97. I try to avoid things that break between versions.
    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
  •