A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

loop through records



 
 
Thread Tools Display Modes
  #1  
Old August 21st, 2005, 12:05 PM
The Iconoclast
external usenet poster
 
Posts: n/a
Default 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  
Old August 21st, 2005, 01:16 PM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

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  
Old August 21st, 2005, 01:43 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

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  
Old August 22nd, 2005, 01:24 PM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

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

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 08:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.