E
Eric
Hi,
I am trying to get a simple loop to function when I load a
form. I have it set on the on load function of the form.
For some reason no matter what I do the loop won't run
when I load the form. I have verified the syntax and know
that's not the problem. The weirdest thing is when I use
a Toggle Breakpoint and step through the code on load it
works fine, it goes through the loop without error as it
should. I have tried everything to troubleshoot this
problem including putting message boxes before and after
the loop, all of which output the message. I have tried
to have a module called to run the loop but still it
didn't work. I've also tried to put the loop under all
other kinds of properties such as on timer. The only way
I can get the loop to run is if I make a command button
and put the loop under the on click property. I need this
to be automated in the background, any suggestions on what
I need to do? Here is the loop:
Dim Counter
Counter = Me.CurrentRecord
Do While Counter <= Me.CountofRecords
Me.SampleReceived = True
DoCmd.GoToRecord , , acNext
Counter = Me.CurrentRecord
Loop
Thanks for any help,
Eric
I am trying to get a simple loop to function when I load a
form. I have it set on the on load function of the form.
For some reason no matter what I do the loop won't run
when I load the form. I have verified the syntax and know
that's not the problem. The weirdest thing is when I use
a Toggle Breakpoint and step through the code on load it
works fine, it goes through the loop without error as it
should. I have tried everything to troubleshoot this
problem including putting message boxes before and after
the loop, all of which output the message. I have tried
to have a module called to run the loop but still it
didn't work. I've also tried to put the loop under all
other kinds of properties such as on timer. The only way
I can get the loop to run is if I make a command button
and put the loop under the on click property. I need this
to be automated in the background, any suggestions on what
I need to do? Here is the loop:
Dim Counter
Counter = Me.CurrentRecord
Do While Counter <= Me.CountofRecords
Me.SampleReceived = True
DoCmd.GoToRecord , , acNext
Counter = Me.CurrentRecord
Loop
Thanks for any help,
Eric