Question Sequential Numbers

Steve_T

Registered User.
Local time
Today, 12:07
Joined
Feb 6, 2008
Messages
96
Hello all,
I have a problem that i would be grateful for some help with.
I have a form which is called frmMasterNum which has 3 Textboxes called txtFrom, txtTo and txtTotal.
What i am looking to do is if i put "10010" in txtFrom and put "10015" in txtTo when i press a button the above numbers and all them between will appear in txtTotal eg "10010, 10011, 10012, 10013, 10014, 10015".
I remember seeing a simular thing with dates on here but it created a seperate record on the table for each date which i dont want.
I would be gratefull for any help or direction but if not thanks for looking anyway
 
What i am looking to do is if i put "10010" in txtFrom and put "10015" in txtTo when i press a button the above numbers and all them between will appear in txtTotal eg "10010, 10011, 10012, 10013, 10014, 10015".
Just loop it:
Code:
on click

if me.txtFrom - me.txtTo > 1000 then
  if msgbox "This operation may take a while to cacluate!  Continue?, _
                vbyesno = vbno then
    exit sub
  else
    goto My Loop
  end if

else

MyLoop:
dim i as long

for i = me.txtFrom to me.txtTo

  me.txtTotal = me.txtTotal & cstr(i) & ", "

next i

me.txtTotal = left(me.txtTotal, len(me.txtTotal) - 2)

end if
 
Ajetrumpet / Adam
Thank you for taking the time to help me with this one, as i am sure you have gathered i am very new to Access but i am trying my best to self teach by setting my self challenges.
However more often then not i have to turn to the skill and knowledge of others like yourself on this forum.
I am amazed by the help, support and patients i have been shown on this forum and this is more then clear once again by yourself.
Once again thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom