append query to add cheque book series (1 Viewer)

azeeshan

New member
Local time
Today, 12:26
Joined
May 5, 2016
Messages
5
Hi Friends,

I want to append cheque book series by providing first and last value of cheque series or any other way to append number series upto specfic number. For example

append data in chqnumbers field between 3456610 up to 3456610+75, thus by executing the query, chq numbers are filled like
3456610
3456611
3456612
........
........
.......
3456685

appreciate your soonest response.

regards
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 19:26
Joined
Jul 9, 2003
Messages
16,244
Quickest and easiest way for you to do it yourself would be to create the list in Excel and then import that into Access...
 

plog

Banishment Pending
Local time
Today, 14:26
Joined
May 11, 2011
Messages
11,611
Can you explain what you would like the exact process to be? Is a user going to open a form? Will there be inputs for first/last check numbers? How often will this be run?
 

azeeshan

New member
Local time
Today, 12:26
Joined
May 5, 2016
Messages
5
Thanks for taking interest.

Let say i have a form with a subform, on the main form i have 2 fields "first" and "last" both number fields. and on subform i have one field "chq_no" which is numeric as well.
and a button on main form representing the append query behind.

if i insert number 1 in first field and number 15 in last field then upon pressing the button, subform chq_no field is inserted with a series of numbers between 1 and 15 like below

chq_no
1
2
3
.
.
.
15

i just need to know how to use append query by adding +1 and make series.
regards
 

plog

Banishment Pending
Local time
Today, 14:26
Joined
May 11, 2011
Messages
11,611
In that instance you would put code on the button to run VBA. That code would do the following:

Put the starting value into a variable (int_CheckNumber)
Put the ending value into a variable (int_LastNumber)
Run a loop (either for or while) from starting value to ending value.
Execute an APPEND query using Docmd.RunSQL that inserts a record with int_CheckNumber
Update int_CheckNumber to int_CheckNumber +1
 

azeeshan

New member
Local time
Today, 12:26
Joined
May 5, 2016
Messages
5
I don't know how to write vba code, it would be helpful, if you could explain me a step by step instructions...
appreciate your cooperation.
 

plog

Banishment Pending
Local time
Today, 14:26
Joined
May 11, 2011
Messages
11,611
If you need this done then I suggest you start learning how to code VBA. This would be a good beginner level project.
 

Users who are viewing this thread

Top Bottom