Creating a list of sequential numbers

E

eb1mom

Transistion from paper to electronic forms is going very
slowly. I am trying to bridge gaps. Requisition forms are
triple copy pads with sequential numbers. I have been told
to make requistion form in Access using numbers from actual
paper forms. Some departments will still be using paper. Is
there any way I can enter a list of 100 sequential numbers
in a table without typing them all out? This month my
department will be using requisition numbers 112400-112499.
Next month maybe 121100-121199. Any suggestions?
 
P

Paul

This may be a brutish way of doing that, but what I've
done, assuming you're entering infor at the dataview
level, is just used Excel to increment the numbers for
me. If you type a number in an Excel cell, then grab the
plus sign at the lower right corner of the cell and drag
down, the succeeding cells will increment by 1. Then,
when you get your list, just cut-'n'-past as new records
into your table if this is the primary key.

Can't say I know Access well enough to be more elegant.
 
C

Chris Nebinger

Sub AddNewNumbers(lngStart as Long, lngEnd as Long)

dim lngCounter as Long

for lngCount = lngStart to lngEnd
CurrentDB.Execute "Insert Into YOURTABLENAME
(YOURFIELDNAME) Values (" & lngCounter & ")"
next lngCount

End Sub


You would call it like:


AddNewNumbers 121100,121199


Chris Nebinger
 

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