PC Review


Reply
Thread Tools Rate Thread

creating data for values between 2 numbers

 
 
BrakX
Guest
Posts: n/a
 
      14th Mar 2010
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?
--
BrakX

 
Reply With Quote
 
 
 
 
Daniel Pineault
Guest
Posts: n/a
 
      14th Mar 2010
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" wrote:

> 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?
> --
> BrakX
>

 
Reply With Quote
 
BrakX
Guest
Posts: n/a
 
      14th Mar 2010
Thanks for the quick reply... just gotta figure out how to use it. Still
kinda learnin Access.
--
BrakX

"Daniel Pineault" wrote:

> 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" wrote:
>
> > 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?
> > --
> > BrakX
> >

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      14th Mar 2010
On Sun, 14 Mar 2010 15:38:01 -0700, BrakX <(E-Mail Removed)>
wrote:

>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.
--

John W. Vinson [MVP]
 
Reply With Quote
 
BrakX
Guest
Posts: n/a
 
      16th Mar 2010
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" wrote:

> On Sun, 14 Mar 2010 15:38:01 -0700, BrakX <(E-Mail Removed)>
> wrote:
>
> >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.
> --
>
> John W. Vinson [MVP]
> .
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      16th Mar 2010
On Mon, 15 Mar 2010 21:23:01 -0700, BrakX <(E-Mail Removed)>
wrote:

>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?
--

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating reference numbers from column of data LucasD Microsoft Excel Worksheet Functions 3 25th Sep 2008 03:23 PM
Count numbers and non numbers(conditional values) Ecoman Microsoft Excel Misc 5 9th May 2008 04:56 PM
Convert numbers stored as text to numbers errors after loading data in jobs Microsoft Excel Programming 2 28th Mar 2007 02:57 AM
creating a combo box that uses a list of values in data access pag =?Utf-8?B?TlNOb3Vy?= Microsoft Access 0 19th Jun 2006 10:42 AM
can numbers be assigned to values, replacing values for numbers =?Utf-8?B?Q29zc2xvZmZl?= Microsoft Excel Misc 2 3rd Jun 2006 10:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:37 PM.