Auto Number Generation within a range

In a particular form, I want to automatically generate receipt numbers within certain range. The users should be prompted to enter the lower limit and upper limit and the automatic generation of  numbers should be within these limits. Please give me some coding guidelines.
r_venkatadhriAsked:
Who is Participating?
 
Richie_SimonettiConnect With a Mentor IT OperationsCommented:
Or
dim LNum as long,Hnum as long
LNum=inputbox$("Please enter lower number")
HNum=inputbox$("Please enter High number")
if (lnum<>"" and hnum <>"" and lnum<hnum) then
   dim i as long
   for i= LNum to HNum
      debug.print i
   next i
end if

0
 
jbilCommented:
Option Explicit
Private Sub Form_Load()
Randomize Timer
End Sub

Private Sub Command1_Click()

Dim HighNum As Integer
Dim LowNum As Integer
HighNum = Text1
LowNum = Text2
HighNum = HighNum - LowNum
Text3 = Int(Rnd * HighNum) + LowNum

End Sub


0
 
rspahitzCommented:
Are you looking for a sequential list of the numbers in the range, a random list of numbers, or a single number to be returned?
0
 
Richie_SimonettiIT OperationsCommented:
dim i as long
for i= LNum to HNum
    debug.print i
next i
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.