14ca5 Recordset Loop Unexpected Behaviour
Sign Up |  Live StatsLive Stats    Articles 37,470| Comments 178,653| Members 19,495, Newest singhajay| Online 463
Home Contact
 (Forgotten?): 
    10 years of Excellence
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags

Recordset Loop Unexpected Behaviour

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 0 USD (0%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Behaviour in the Gurdwara Hardkaur Sikh Youth 21 07-Nov-2008 06:43 AM
Textbox behaviour JOM Information Technology 1 28-Jul-2006 08:38 AM
Unexpected Values on Reports Simon Harris Information Technology 2 28-Jul-2006 08:36 AM
Unexpected results hughess7 Information Technology 9 28-Jul-2006 08:35 AM
how to stop an infinite loop? Gijs van Swaaij Information Technology 6 28-Jul-2006 08:22 AM


Tags
recordset, loop, unexpected, behaviour
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:23 AM
Simon Harris's Avatar Simon Harris
Guest
 
Posts: n/a
   
   
Recordset Loop Unexpected Behaviour

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Hi All,

The following code is only showing me one message box with one idInvoice.
Yet the SQL behind it returns 4 distinct rows, each with a different
idInvoice.

Set conn = CurrentDb
Set RSCheckCurrentReadings = conn.OpenRecordset(strSQL)
Do While Not RSCheckCurrentReadings.EOF
MsgBox (CInt(RSCheckCurrentReadings("idInvoice")))
RSCheckCurrentReadings.MoveNext
Loop

Any ideas will be much appreciated!

Thanks!
Simon.

--
-
* Please reply to group for the benefit of all
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/11718-recordset-loop-unexpected-behaviour.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11718
* Found the answer to your own question? Post it!
* Get a useful reply to one of your posts?...post an answer to another one
* Search first, post later : http://www.google.co.uk/groups
* Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!




Do you agree or disagree with the writer above? Why not share your immediate thoughts with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:23 AM
John Vinson's Avatar John Vinson
Guest
 
Posts: n/a
   
   
Re: Recordset Loop Unexpected Behaviour

On Mon, 19 Jun 2006 2103 +0100, "Simon Harris"
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11718
wrote:

>Hi All,
>
>The following code is only showing me one message box with one idInvoice.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11718
>Yet the SQL behind it returns 4 distinct rows, each with a different
>idInvoice.
>
>Set conn = CurrentDb
>Set RSCheckCurrentReadings = conn.OpenRecordset(strSQL)
>Do While Not RSCheckCurrentReadings.EOF
> MsgBox (CInt(RSCheckCurrentReadings("idInvoice")))
> RSCheckCurrentReadings.MoveNext
>Loop
>
>Any ideas will be much appreciated!
>
>Thanks!
>Simon.


It may be helpful to put a line

RSCheckCurrentReadings.MoveFirst

before the DO WHILE loop.

John W. Vinson[MVP]
Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:23 AM
Graham Mandeno's Avatar Graham Mandeno
Guest
 
Posts: n/a
   
   
Re: Recordset Loop Unexpected Behaviour

  Donate Today!  
Hi Simon

No idea. But have you declared your object variables correctly?

Dim conn as DAO.Database
Dim RSCheckCurrentReadings as DAO.Recordset

I'm suspicious that your variable name "conn" suggests an ADODB.Connection,
while it should be a DAO.Database.

Also, have you tried?
RSCheckCurrentReadings.MoveLast
MsgBox RSCheckCurrentReadings.RecordCount

Of course, this should give 4.

If you're still in trouble, post some more code including variable
declarations and the value of strSQL.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Simon Harris" wrote in message
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11718
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11718
news:u74RFz9kGHA.4888@TK2MSFTNGP02.phx.gbl...
> Hi All,
>
> The following code is only showing me one message box with one idInvoice.
> Yet the SQL behind it returns 4 distinct rows, each with a different
> idInvoice.
>
> Set conn = CurrentDb
> Set RSCheckCurrentReadings = conn.OpenRecordset(strSQL)
> Do While Not RSCheckCurrentReadings.EOF
> MsgBox (CInt(RSCheckCurrentReadings("idInvoice")))
> RSCheckCurrentReadings.MoveNext
> Loop
>
> Any ideas will be much appreciated!
>
> Thanks!
> Simon.
>
> --
> -
> * Please reply to group for the benefit of all
> * Found the answer to your own question? Post it!
> * Get a useful reply to one of your posts?...post an answer to another one
> * Search first, post later : http://www.google.co.uk/groups
> * Want my email address? Ask me in a post...Cos2MuchSpamMakesUFat!
>



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
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

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

» Active Discussions
Can Sikhs worship...
Today 23:01 PM
14 Replies, 128 Views
English Sri Guru Granth Sahib Ji Translations
By sikh15
Today 22:27 PM
5 Replies, 83 Views
Sikh Philosophy Network...
Today 22:26 PM
16 Replies, 757 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 21:25 PM
256 Replies, 6,068 Views
Difference in Bowing...
By Kamala
Today 15:08 PM
11 Replies, 259 Views
What Really Happened on...
Today 12:46 PM
13 Replies, 215 Views
Free Online Gurbani...
Today 03:56 AM
13 Replies, 4,339 Views
English Sri Guru Granth...
Today 03:51 AM
5 Replies, 171 Views
Edward Snowden: the...
Today 03:34 AM
3 Replies, 185 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 03:23 AM
407 Replies, 9,441 Views
What Is Difference...
Yesterday 09:18 AM
6 Replies, 183 Views
First There is Water by...
By Ishna
Yesterday 05:03 AM
3 Replies, 192 Views
Cooking Without Alcohol
Yesterday 02:12 AM
12 Replies, 203 Views
Learning from Baba...
Yesterday 01:38 AM
0 Replies, 312 Views
Eckhart Tolle
17-Jun-2013 18:08 PM
2 Replies, 134 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 23:05 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.74434 seconds with 32 queries
0