Loop

ant1983za

Registered User.
Local time
Tomorrow, 00:32
Joined
Jul 2, 2013
Messages
14
Hi,

So I have copied a piece of code from someone and want to adapt it for what i want to do but I'm stuck. (I'm a newbie so to you guyz this is probably relatively simple)

This is the code:

For i = 1 To 9

If IsNull(Me("txtStreetNumber" & i)) Then
Exit For
End If

And then the code carries on by insert the Me("FieldName" & i) in certain places. The code then finishes off with:

"Next i"

Right... all of this is bound to a click event on a button and the fields all refer to unbound text boxes on the form...

This is where my situation is different:

My fields arent unbound text boxes. They are fields in a form run from a table and they are in datasheet view.

So in a nutshell my question is:

How do I loop something unlimited times, per line.

Dang i hope that made sense :)

Thanks!

Ant

 

How do I loop something unlimited times, per line.

Dang i hope that made sense :)
Afraid not! How can you "loop something unlimited times, per line?" The process would be never ending! I'm afraid you'll have to do a better job of explaining your scenario if you want us to help you, here, but simply put, if you want Access to do something, X number of times, you have to tell the Access Gnomes the value of X!

Linq ;0)>
 
Fair Enough. After clicking around this is what i think i want to do though its telling me 'Object Required':

Private Sub Form_Load()

Dim rst As Object
Set rst = BlahBlah

Do While Not rst.EOF

******CODE GOES HERE******

rs.MoveNext

Loop

End Sub
 
Your code seems to be very OK :)))))))))

Can you upload your database and tell us what you try to achieve ?
 

Users who are viewing this thread

Back
Top Bottom