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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Back to the loop that doesn't loop



 
 
Thread Tools Display Modes
  #11  
Old January 30th, 2009, 01:41 PM posted to microsoft.public.access.gettingstarted
Gina Whipp
external usenet poster
 
Posts: 3,500
Default Back to the loop that doesn't loop

Your welcime!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"TeeSee" wrote in message
...
On Jan 28, 10:35 pm, "Gina Whipp" wrote:
Oops, forgot...

This might help in understanding the difference between a RecordsetClone
and
a Recordset: http://www.fmsinc.com/free/newtips/A...ccesstip26.asp

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index.htm

"TeeSee" wrote in message

...
On Jan 28, 8:29 pm, "Gina Whipp" wrote:





TeeSee,


I'm not sure I understand what you are trying to do...


If Check2 = False you want to change to True and visa versa?


--
Gina Whipp


"I feel I have been denied critical, need to know, information!" -
Tremors
II


http://www.regina-whipp.com/index.htm


"TeeSee" wrote in message


...
On Jan 28, 8:04 pm, TeeSee wrote:


A couple of weeks ago I posted a looping code that I couldn't get
right and I was steered (thankfully) towards SQL which I have made
great use of since, however I didn't actually learn what I was doing
wrong with the loopy code.
I have a similar problem again now and the problem specifically
is ......


I can't get off the first record!


The code compiles (honest). The recordset is what I expect. The
recordcount is correct. As the code steps thru its cycle I can see in
the Immediate window that the values are changing from -1 to 0 and
then on the second cycle back from 0 to -1. My item code shows that
both cycles are for record 1


Could someone please explain


Sorry ...I forgot to add the code. Time for bed!


Private Sub Command4_Click()
Dim rs As DAO.Recordset
Dim X As Integer


Set rs = Me.RecordsetClone


Debug.Print rs.RecordCount
rs.MoveFirst
For X = 1 To rs.RecordCount


Debug.Print SISItemCode.Value
If Me.Check2 = True Then


Debug.Print Me!Check2.Value
Me.Check2 = False
Debug.Print Me!Check2.Value
ElseIf Me.Check2 = False Then
Debug.Print Me!Check2.Value
Me.Check2 = True
Debug.Print Me!Check2.Value
End If
rs.MoveNext
Next X
End Sub- Hide quoted text -


- Show quoted text -


That is correct! Don't take this next question the wrong way please.
Regardless of what I'm trying to do all I would really like an answer
to is why can't i get past the first record??

Thanks for responding.- Hide quoted text -

- Show quoted text -


Many thanks Gina. The loopy code now loops. Thanks also for the info
re rs'clone


 




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


All times are GMT +1. The time now is 12:45 AM.


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