Loop question

rikklaney1

Registered User.
Local time
Today, 05:28
Joined
Nov 20, 2014
Messages
157
Here is another hypothetical question. If I have a form with ten text boxes. text boxes 2 through ten have a default value of the previous value plus 1. So....

TEXTBOX1
TEXTBOX2 default value =[textbox1] +1
TEXTBOX3 default value =[textbox2] +1
TEXTBOX4 default value =[textbox3] +1
TEXTBOX5 default value =[textbox4] +1
TEXTBOX6 default value =[textbox5] +1
TEXTBOX7 default value =[textbox6] +1
TEXTBOX8 default value =[textbox7] +1
TEXTBOX9 default value =[textbox8] +1
TEXTBOX10 default value =[textbox9] +1


So if I enter 239 in textbox1 I get

239
240
241
242
243
244
245
246
247
248

Then If I change textbox2 to 242 it's

239
242
243
244
245
246
247
248
249
250


And now I cahnge textbox3 back to 240

239
242
240
241
242
243
244
245
246
247

Now I have 242 for the value of textbox2 and textbox5. So the question is how can I write a loop that will look at the previous textboxes and if a number exists skip to the next number that doesn't exist ina any of the previous textboxes?
 
Can you tell us about the application where this would be part of the solution? There may be some options, but it would be good if readers understood a little about the business issue.
 
There is no application or business side. It's a hypothetical. A learning exercise if you will on how to create a do/until loop.
 
Your hypothetical question is no good since default values cannot be based on something in the current record - once the record exists defaults are not applied. To loop over controls search the forum for ... loop over controls
 
Thanks Jdraw. I'm seeing some examples there that are making things seem clearer.
 

Users who are viewing this thread

Back
Top Bottom