Need help with Looping

Jass7869

Registered User.
Local time
Today, 12:30
Joined
Aug 12, 2014
Messages
96
I have a code that I am currenly using with a button to move to the next record.

I just want it to loop by itself. I am currently having to press the Update button for it to move to the next record.

Thank You

Private Sub UpdateAllComments_Click()
Dim memoContent As String
memoContent = Me.Remarks1
If Not Me.Recordset.EOF Then
Me.Recordset.MoveNext
Me.Recordset.EOF
Me.Remarks1 = memoContent
Me.Repaint

Call TrackUser
Else
MsgBox "Already at last record"
End If
End Sub
 
In English, what are you trying to do? What precisely are you looping through, and what are you trying to do? It looks like you want to take the contents of a memo field from one record and paste it into the same field in the next record.
 
Sorry If I was not clear enough...What you described is exactly what it is doing right now. I am just taking the Comments from one record and copying that into another record..same field.

But currently for me to move through the records..I have to keep clicking a button. I need for it to move through the records automatically. That's what I need help with. Please no sarcasm...
 
I think this code will do what you want - based on your post.
Code:
Private Sub UpdateAllComments_Click()
Dim memoContent As String
memoContent = Me.Remarks1
Do while Not Me.Recordset.EOF 
  
 Me.Remarks1 = memoContent
 Me.Repaint
 Call TrackUser
 Me.Recordset.MoveNext
Loop

MsgBox "Already at last record"
End Sub


What does Call TrackUser do?
Good luck
 
Call TrackUser ...Track anybody in the unit that is making a change to the record. Accountability
 
Wow that worked...now I will post another question. Please look for it
 
I go to lunch and jdraw steals my thun...er...saves the day! :D
 

Users who are viewing this thread

Back
Top Bottom