creating data for values between 2 numbers

B

BrakX

This is something that I have been trying to do for a long time and sort of
gave up on it... but since the issue came up again, I’m going to try to ask
for help again.

I issue out forms, all with sequential numbers on them, to customers. These
forms have lots of data on them like Name, License plate number, destination,
ext. Right now with my current database, if I issue 1000 forms to the same
person, and they are using the same vehicle, I have put all the data in the
1st form, save it, carry it over, and then change the number and save it
again... and do this 1000 times until all the numbers are in the database. So
what I’m asking is, is there a way that I can put in the start value, the
finish value in to a form and all the data in between would be autofilled in
to the tables?
 
D

Daniel Pineault

Yes, you could automate this task by automating an append query to your
underlying table

Dim sSQL As String
Dim iStartNo As Long
Dim iEndNo As Long

iStartNo = InputBox("What is the start number to use?")
iEndNo = InputBox("What is the end number to use?")

for i = iStartNo To iEndNo
sSQL = "INSERT INTO YOURTABLE (YOUR FIELDS..., [FromNo]) VALUES(" & _
yourformfield & ", " & i);"
Next i

CurrentDb.Execute sSQL

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
B

BrakX

Thanks for the quick reply... just gotta figure out how to use it. Still
kinda learnin Access.
--
BrakX

Daniel Pineault said:
Yes, you could automate this task by automating an append query to your
underlying table

Dim sSQL As String
Dim iStartNo As Long
Dim iEndNo As Long

iStartNo = InputBox("What is the start number to use?")
iEndNo = InputBox("What is the end number to use?")

for i = iStartNo To iEndNo
sSQL = "INSERT INTO YOURTABLE (YOUR FIELDS..., [FromNo]) VALUES(" & _
yourformfield & ", " & i);"
Next i

CurrentDb.Execute sSQL

--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



BrakX said:
This is something that I have been trying to do for a long time and sort of
gave up on it... but since the issue came up again, I’m going to try to ask
for help again.

I issue out forms, all with sequential numbers on them, to customers. These
forms have lots of data on them like Name, License plate number, destination,
ext. Right now with my current database, if I issue 1000 forms to the same
person, and they are using the same vehicle, I have put all the data in the
1st form, save it, carry it over, and then change the number and save it
again... and do this 1000 times until all the numbers are in the database. So
what I’m asking is, is there a way that I can put in the start value, the
finish value in to a form and all the data in between would be autofilled in
to the tables?
 
J

John W. Vinson

This is something that I have been trying to do for a long time and sort of
gave up on it... but since the issue came up again, I’m going to try to ask
for help again.

I issue out forms, all with sequential numbers on them, to customers. These
forms have lots of data on them like Name, License plate number, destination,
ext. Right now with my current database, if I issue 1000 forms to the same
person, and they are using the same vehicle, I have put all the data in the
1st form, save it, carry it over, and then change the number and save it
again... and do this 1000 times until all the numbers are in the database. So
what I’m asking is, is there a way that I can put in the start value, the
finish value in to a form and all the data in between would be autofilled in
to the tables?

One way to do this is to use a handy auxiliary table: I'll routinely create a
table Num with one Long integer Number field N, and fill it with values from 0
through 10000 or so (as many records as you'll be printing out all at once; be
generous). You can use Excel.. Insert... Fill Series to create the list of
numbers and import or copy and paste it into Num.

It's probably not necessary to actually *store* 1000 records to do this,
unless you're going to be editing all or most of them later. Are you??? if
not, then you can store the data for a given vehicle once, and just print off
1000 copies of the report by basing the report on a Query. Include whatever
table or tables you need to display the data, and include Num in the query
with *no join line*. Have a Form with unbound textboxes named txtStart and
txtEnd. Put a criterion on N of

<= [Forms]![YourForm]![txtEnd] - [Forms]![YourForm]![txtStart]

to return numbers N from 0 through the number of records to print; on the
Report put a textbox with a control source

=[Forms]![YourForm]![txtstart] + [N]

This will let you store the data nonredundantly, but still print 1000 (or
10000, or however many rows you put into Num) unique sheets of paper.
 
B

BrakX

Well, I shouldn't be modifing much of the data later on, but I do need to
store it. I will give that a try and see how it works. I would like to do
it in a form in Acess though... Im trying to make it as user friendly as
possable so I am not the one putting in all the data.

Thanks for the help.
--
BrakX


John W. Vinson said:
This is something that I have been trying to do for a long time and sort of
gave up on it... but since the issue came up again, I’m going to try to ask
for help again.

I issue out forms, all with sequential numbers on them, to customers. These
forms have lots of data on them like Name, License plate number, destination,
ext. Right now with my current database, if I issue 1000 forms to the same
person, and they are using the same vehicle, I have put all the data in the
1st form, save it, carry it over, and then change the number and save it
again... and do this 1000 times until all the numbers are in the database. So
what I’m asking is, is there a way that I can put in the start value, the
finish value in to a form and all the data in between would be autofilled in
to the tables?

One way to do this is to use a handy auxiliary table: I'll routinely create a
table Num with one Long integer Number field N, and fill it with values from 0
through 10000 or so (as many records as you'll be printing out all at once; be
generous). You can use Excel.. Insert... Fill Series to create the list of
numbers and import or copy and paste it into Num.

It's probably not necessary to actually *store* 1000 records to do this,
unless you're going to be editing all or most of them later. Are you??? if
not, then you can store the data for a given vehicle once, and just print off
1000 copies of the report by basing the report on a Query. Include whatever
table or tables you need to display the data, and include Num in the query
with *no join line*. Have a Form with unbound textboxes named txtStart and
txtEnd. Put a criterion on N of

<= [Forms]![YourForm]![txtEnd] - [Forms]![YourForm]![txtStart]

to return numbers N from 0 through the number of records to print; on the
Report put a textbox with a control source

=[Forms]![YourForm]![txtstart] + [N]

This will let you store the data nonredundantly, but still print 1000 (or
10000, or however many rows you put into Num) unique sheets of paper.
 
J

John W. Vinson

Well, I shouldn't be modifing much of the data later on, but I do need to
store it. I will give that a try and see how it works. I would like to do
it in a form in Acess though... Im trying to make it as user friendly as
possable so I am not the one putting in all the data.

You can certainly open this report (to print a thousand pages) from a Form. I
guess I don't understand what you're getting at; will the data to be printed
all be entered ad hoc at the time of printing? or is there data in one or more
Tables, which will be printed in a thousand copies?

What's the context? What's the current structure of your database?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top