PC Review


Reply
Thread Tools Rate Thread

Best method for updating records from a query?

 
 
Brian Beck
Guest
Posts: n/a
 
      1st Jun 2007
Here is what I want to do in a nutshell...All the records that are returned
from a particular query, I want to set a flag in each of those records to
true and also set the flag that was used to identify those records for the
query to false.

I've got various flags for records in a table to indicate whether a record
is ready to have a letter generated, whether a letter has been generated,
and whether a letter has been sent. Currently I'm using a query,
qSevere_Letter to grab all the records that have the flag
GenerateSevereLetter set to true. This query is used in conjunction with a
Microsoft Word template to generate letters for each record.

Once I've generated the letters, I'd like to be able to programmatically
have Access take each of the records in the query, set the flag
SevereLetterGeneratedFlag to true and also change the
GenerateSevereLetterFlag to false...this way I won't grab those records the
next time I generate letters.

Is this possible using macros or stored procedures, and if so, how would I
proceed?

-Brian


 
Reply With Quote
 
 
 
 
Jason Lepack
Guest
Posts: n/a
 
      1st Jun 2007
You just need a simple Update query

UPDATE
yourTableName
SET
GenerateSevereLetterFlag = False,
SevereLetterGeneratedFlag = True
WHERE
GenerateSevereLetterFlag=True

Cheers,
Jason Lepack
On Jun 1, 2:18 pm, "Brian Beck" <brian.b...@tea.state.tx.us> wrote:
> Here is what I want to do in a nutshell...All the records that are returned
> from a particular query, I want to set a flag in each of those records to
> true and also set the flag that was used to identify those records for the
> query to false.
>
> I've got various flags for records in a table to indicate whether a record
> is ready to have a letter generated, whether a letter has been generated,
> and whether a letter has been sent. Currently I'm using a query,
> qSevere_Letter to grab all the records that have the flag
> GenerateSevereLetter set to true. This query is used in conjunction with a
> Microsoft Word template to generate letters for each record.
>
> Once I've generated the letters, I'd like to be able to programmatically
> have Access take each of the records in the query, set the flag
> SevereLetterGeneratedFlag to true and also change the
> GenerateSevereLetterFlag to false...this way I won't grab those records the
> next time I generate letters.
>
> Is this possible using macros or stored procedures, and if so, how would I
> proceed?
>
> -Brian



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form, Query, and Updating Records pcstechnical.sfhs@gmail.com Microsoft Access Form Coding 4 26th Sep 2007 11:14 AM
Updating Records in a Query =?Utf-8?B?VmlubnkgUA==?= Microsoft Access Queries 1 5th Apr 2007 05:24 PM
Query Not Updating All Records =?Utf-8?B?SmVzcw==?= Microsoft Access Queries 1 27th Sep 2006 04:18 PM
Query (or other method) to compress multiple records to one. Paul Blay Microsoft Access Queries 1 14th Jan 2005 10:27 PM
Updating and Adding Records via a Query ZBC Microsoft Access Queries 2 5th May 2004 12:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:35 AM.