Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Correct VBA for DO WHILE i.e. X=X AND NOT RS.EOF

2003/2007

Attempting to:

CASE #1

Do While TranNumMem = TransactionsRS!TranNum AND NOT RS.EOF

' xxxxxxx
' xxxxxxx
rs.movenext
Loop

The clause TranNumMem = TransactionsRS!TranNum works but the
AND NOT RS.EOF is not working

I worked around with:

CASE #2

Do While TranNumMem = TransactionsRS!TranNum

' xxxxxxx
' xxxxxxx
rs.movenext
If RS.EOF Then Exit Do

Loop


How could I make CASE #1 work??

TIA EagleOne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Correct VBA for DO WHILE i.e. X=X AND NOT RS.EOF

Nothing wrong with how you're doing it, however you may wish to try using
the Recordset as the main section of the loop, and the test inside that loop.
Something like the following.
'New Version of Case #1
Do While Not RS.EOF
'01 - Test for TranNumMem
If TranNumMem = TransactionsRS!TranNum Then Exit Do
' xxxxxxx
' xxxxxxx

RS.movenext
Loop 'While Not RS.EOF




" wrote:

2003/2007

Attempting to:

CASE #1

Do While TranNumMem = TransactionsRS!TranNum AND NOT RS.EOF

' xxxxxxx
' xxxxxxx
rs.movenext
Loop

The clause TranNumMem = TransactionsRS!TranNum works but the
AND NOT RS.EOF is not working

I worked around with:

CASE #2

Do While TranNumMem = TransactionsRS!TranNum

' xxxxxxx
' xxxxxxx
rs.movenext
If RS.EOF Then Exit Do

Loop


How could I make CASE #1 work??

TIA EagleOne

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Correct VBA for DO WHILE i.e. X=X AND NOT RS.EOF

Thanks

Code Johnny wrote:

Nothing wrong with how you're doing it, however you may wish to try using
the Recordset as the main section of the loop, and the test inside that loop.
Something like the following.
'New Version of Case #1
Do While Not RS.EOF
'01 - Test for TranNumMem
If TranNumMem = TransactionsRS!TranNum Then Exit Do
' xxxxxxx
' xxxxxxx

RS.movenext
Loop 'While Not RS.EOF




" wrote:

2003/2007

Attempting to:

CASE #1

Do While TranNumMem = TransactionsRS!TranNum AND NOT RS.EOF

' xxxxxxx
' xxxxxxx
rs.movenext
Loop

The clause TranNumMem = TransactionsRS!TranNum works but the
AND NOT RS.EOF is not working

I worked around with:

CASE #2

Do While TranNumMem = TransactionsRS!TranNum

' xxxxxxx
' xxxxxxx
rs.movenext
If RS.EOF Then Exit Do

Loop


How could I make CASE #1 work??

TIA EagleOne

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Correct VBA for DO WHILE i.e. X=X AND NOT RS.EOF

Code Johnny wrote:

Nothing wrong with how you're doing it, however you may wish to try using
the Recordset as the main section of the loop, and the test inside that loop.
Something like the following.
'New Version of Case #1
Do While Not RS.EOF
'01 - Test for TranNumMem
If TranNumMem = TransactionsRS!TranNum Then Exit Do
' xxxxxxx
' xxxxxxx

RS.movenext
Loop 'While Not RS.EOF




" wrote:

2003/2007

Attempting to:

CASE #1

Do While TranNumMem = TransactionsRS!TranNum AND NOT RS.EOF

' xxxxxxx
' xxxxxxx
rs.movenext
Loop

The clause TranNumMem = TransactionsRS!TranNum works but the
AND NOT RS.EOF is not working

I worked around with:

CASE #2

Do While TranNumMem = TransactionsRS!TranNum

' xxxxxxx
' xxxxxxx
rs.movenext
If RS.EOF Then Exit Do

Loop


How could I make CASE #1 work??

TIA EagleOne

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct #N/A Value winnie123 Excel Worksheet Functions 6 February 18th 09 02:17 PM
If correct, add 1 sparky3883 Excel Worksheet Functions 2 October 11th 05 07:52 PM
I will never, ever get this correct ... Dave Peterson[_3_] Excel Programming 0 September 2nd 03 03:34 PM
I will never, ever get this correct ... Vasant Nanavati[_2_] Excel Programming 0 September 2nd 03 03:33 PM
I will never, ever get this correct ... Don Guillett[_4_] Excel Programming 0 September 2nd 03 03:26 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"