If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
loop through records
Greetings.
Could anyone please help me on this, I have a table that contains a true/false field. Upon extracting several "false" records by means of a query how do I make a procedure/macro that would automatically loop through the records and replace the "false" with "true" Thank you |
#2
|
|||
|
|||
There's no need to loop through a recordset; you can use set processing to
get the job done in a fraction of the time it would take using row processing. In other words, use an action query: Dim sSQL As String sSQL = "UPDATE myTable SET myField = False WHERE myField = True" CurrentDb.Execute sSQL, dbFailOnError 'All done! :-) Regards, Graham R Seach Microsoft Access MVP Sydney, Australia --------------------------- "The Iconoclast" wrote in message ... Greetings. Could anyone please help me on this, I have a table that contains a true/false field. Upon extracting several "false" records by means of a query how do I make a procedure/macro that would automatically loop through the records and replace the "false" with "true" Thank you |
#3
|
|||
|
|||
All done, except for the fact that you antipodeans always get things
backwards. Must come from walking around upside down... g, d & r The request was to 'replace the "false" with "true"', so you'd want sSQL = "UPDATE myTable SET myField = True WHERE myField = False" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Graham R Seach" wrote in message ... There's no need to loop through a recordset; you can use set processing to get the job done in a fraction of the time it would take using row processing. In other words, use an action query: Dim sSQL As String sSQL = "UPDATE myTable SET myField = False WHERE myField = True" CurrentDb.Execute sSQL, dbFailOnError 'All done! :-) Regards, Graham R Seach Microsoft Access MVP Sydney, Australia --------------------------- "The Iconoclast" wrote in message ... Greetings. Could anyone please help me on this, I have a table that contains a true/false field. Upon extracting several "false" records by means of a query how do I make a procedure/macro that would automatically loop through the records and replace the "false" with "true" Thank you |
#4
|
|||
|
|||
What's 32768 between friends?
-Thanks Doug! Regards, Graham R Seach Microsoft Access MVP Sydney, Australia --------------------------- "Douglas J. Steele" wrote in message ... All done, except for the fact that you antipodeans always get things backwards. Must come from walking around upside down... g, d & r The request was to 'replace the "false" with "true"', so you'd want sSQL = "UPDATE myTable SET myField = True WHERE myField = False" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Graham R Seach" wrote in message ... There's no need to loop through a recordset; you can use set processing to get the job done in a fraction of the time it would take using row processing. In other words, use an action query: Dim sSQL As String sSQL = "UPDATE myTable SET myField = False WHERE myField = True" CurrentDb.Execute sSQL, dbFailOnError 'All done! :-) Regards, Graham R Seach Microsoft Access MVP Sydney, Australia --------------------------- "The Iconoclast" wrote in message ... Greetings. Could anyone please help me on this, I have a table that contains a true/false field. Upon extracting several "false" records by means of a query how do I make a procedure/macro that would automatically loop through the records and replace the "false" with "true" Thank you |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Records in relational tables | Shawn | Database Design | 5 | June 18th, 2005 12:47 AM |
Information from Table to Report | Dahlman | General Discussion | 6 | April 11th, 2005 09:57 PM |
Attn Sprinks- Not duplicate insert records | babs | Using Forms | 1 | December 13th, 2004 06:25 PM |
How do I Loop through Records | Anderson | New Users | 1 | November 24th, 2004 03:54 AM |
New records can't be seen | rleblanc | Using Forms | 6 | August 14th, 2004 02:43 PM |