That's not what you asked for in the first place (or at least it's not
obvious that that's what you meant: everyone's been given you answers on how
to retrieve the rows that have the numbers you're indicating, not how to
generate them.)
You'll need to use VBA. Here's one approach using DAO. It assumes that every
card in the batch is going to have the same value for Field1 (which it
assumes is numeric) and for Field2 (which it assumes is text), and that
those values are in text boxes txtField1 and txtField2 on the form :
Dim dbCurr As DAO.Database
Dim lngLoop As Long
Dim lngStart As Long
Dim lngStop As Long
Dim strSQL As String
lngStart = InputBox("Enter the starting number:")
lngStop = InputBox("Enter the stopping number:")
If lngStart < lngStop Then
Set dbCurr = CurrentDb()
For lngLoop = lngStart To lngStop
strSQL = "INSERT INTO MyTable (CardNumber, Field1, Field2) " & _
"VALUES(" & lngLoop & "," & txtField1 & ", '" & txtField2 & "')"
dbCurr.Execute strSQL, dbFailOnError
Next lngLoop
Set dbCurr = Nothing
End If
You'll need to add your own error checking to ensure that txtField1 and
txtField2 contain valid values.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Deepak Verma said:
"Unable to enter data" means i'm unable to CREATE records (in the table
name "numbers") for serial numbers starting from [1] and ending on [5].
My problem is that i want to enter just first serial number and the last
serial number and i want the access-table to create records for the values
between these serial numbers.
Now, plz. suggest.
Douglas J. Steele said:
Yes, if you enter 1 and 5, you should get the 5 rows you indicated
(provided they exist).
What do you mean that you're "unable to enter data in it"?
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
Deepak Verma said:
Actually,i've done it.
But i'm unable to enter data in it.
Can i be able to enter data using this like i said, if i enter 1 in
[starting number] and 5 in [ending number], do i get the output as 1, 2,
3, 4, 5.
Base a form or report on a query. In query design view, put something
like this in the Criteria row for the SerialNumber field:
Between [Starting number] And [Ending number]
Hi all
We'r into telecom business and running MIS on MS-Access 2000.
We received around 100 prepaid cards bearing unique serial numbers
viz. 28000011223 to 28000011226.
My problem is:
Is there any way so that if i enter the first serial number and
last serial number, i get the output as
2800011223
2800011224
2800011225
2800011226
plz. suggest.
Thanks and Regards
Deepak
Chandigarh, India.