Inserting into a table a certain number of records in series

ocp&mcsd

The Hitman
Local time
Today, 09:57
Joined
Jan 25, 2006
Messages
113
Hello,
How r u?
I have a small problem.
I have a form with 2 text field, and one button.
Text one is cheque start number.
Text two is number of cheques.
For example, if cheque number was to start from 3, and, number of cheques was 5, I want when clicking the button to insert into the table cheques numbers 3, 4, 5, 6, 7 in sequence.
How can I do so??
 
The task you seek to perform is a relatively easy one, but why would you want to create blank records?
 
Thank u Mr. datAdrenaline
I want to have them in another form with other feilds to be edited.
But, how to do it?
 
how are you getting the payment list?


the way to do this is really to start from the payment list, and then iterate a recordset, setting the chq number for each of these payments.

rather than starting with the blank list of chq numbers
 
>> I want to have them in another form with other feilds to be edited. <<

Forms can be bound to a RecordSource (ie: a Table, Query, or SQL Statement) via the forms RecordSource property. With that, your controls on that form can be bound a control (ie: a Text Box) via the use of the Control Source property of that control.

A form can navigate all records that are returned from the recordsource. A bound form can also be used to add records to the RecordSource by simply navigating to the "New Record Pointer" ... All this is inherent to Access and no code is needed to do these things.

......

Ultimately, I beleive to offer you advice on a proper solution, we will need to know more about your work flow and table structures.
 
Hello mr. datAdrenaline,
when filling the form of two fields, another form will open with the same number of feilds filled along with other field to be edited.
 
[edited - not intending to be curt, but its hard to get anwers when the question you are asking is really going about something in the wrong way]

so you really do need to think about this.

How are you getting your payment list? Are you entering payments directly? Are the payments being generated from an Accounts Payable system? When (at which point) do you need to add the cheque numbers?

Ideally, get the payment list extracted first, ignoring the cheque numbers - then get a procedure to number it.
Or, insert the numbers as you add each payment

But don't do it the other way round - prepare a blank list just with the numbers, and fill the payment details in later.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom