By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,881 Members | 645 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,881 IT Pros & Developers. It's quick & easy.

How to Auto Generate a Primary Key everytime i print a report page in MS Acces

P: 3
I have a MS Access 2003 database that i want to automate generating of an autonumber ID everytime i print.

Example: I have a table Workorders with a WorkorderID which is a Primary Key and Autonumber. I want to have a print button wherein if i have to print 50 pages, all the 50 pages report will have different WorkorderID(incrementing) on it.

Or is this possible in a Query?
May 19 '10 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 2.5K+
P: 2,545
Hi.
I have a MS Access 2003 database that i want to automate generating of an autonumber ID everytime i print.
Autonumbers are used to identify unique rows in a table. Without knowing why you need to generate a new ID every time you print we can't advise you how to do it.

Reports are generally passive documents which summarise entries made; your requirement to change something each time you run the report is not easy to interpret. Can you tell us a bit more about what it is you need, and perhaps post some example data?
Or is this possible in a Query?
Can't say for sure about what can or cannot be done in a query given that it is not clear what you need, but generating new IDs as such - no.

-Stewart
May 23 '10 #2

P: 3
@Stewart Ross Inverness
hello sir. i've made a new post with an attachment of what i want to happen.

this is the title of the post "MS Access New Record and Printing VBA Codes"

thanks.
May 30 '10 #3

9815402440
100+
P: 180
hi
if you just want to display serial number (incremented by given number) then you can use shape command. make a recordset using shape command as follows
"shape {select * from Table1} append new adDouble numSrNo"
use following loop then
i=1
while not rst.eof
rst.fields("numSrNo").value = i
i=i+1
rst.movenext
wend
now bind the control with datareport

regards
manpreet singh dhillon hoshiarpur
Jun 9 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.