473,414 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

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

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
3 1536
Stewart Ross
2,545 Expert Mod 2GB
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
@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
180 100+
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

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

Similar topics

3
by: Billy Jacobs | last post by:
I have a datagrid which I am using as a report in a web application. When I go to print the page from Internet Explorer, the gridlines on the first page print but on subsequent pages the gridlines...
6
by: Sebastien | last post by:
Hi, I am building a products database, linking sales and production. Each part has a unique sales Stock Code and Production Number. The sales stock code is a combination of letters and numbers...
2
by: SalimShahzad | last post by:
Dear Gurus, i had written following codes to auto generate the next claim no Private Const strC = "GCT/02/J/" Private Sub Command1_Click() Dim stra, stre As String Dim intb, intd As Integer...
1
by: kefira | last post by:
My access prints report on both sides of the sheet and I cannot figure it out how to print every report page on the new sheet. Any idea?
0
by: ghadley_00 | last post by:
Hi, Have created 2 seperate reports that have different images as backgrounds. Would like to have both pages print out as 1 print job (so duplex printer will make each report page on opposite...
5
by: Tony Dong | last post by:
Hi there, I am newer for dot net I want to make a report and then print it, the report may include images and text, how can I do that, any one can give me a suggestion? I know how to...
2
by: alexs | last post by:
Chaps, I'm starting to play with db2 V9.1 and am writing a stored procedure to manage accounting records from oiur RADIUS server. I've got an XML aware table with an auto increment primary...
8
by: dougawells | last post by:
Hi - I'm hoping for help with the auto-generation of a hyperlinked listing of all files in a directory. The server I use does not auto-generate this. So, when someone comes to this directory and...
2
by: felicia | last post by:
Can anyone help me on How to use Data Report in VB and how to print report? I hope i can generate the Data Report without Data Environment because I am not fammiliar with it. Simple adodb or adodc...
1
by: ganesh22 | last post by:
hi... I am doing a project asp.net with C#.my requirement I want to do auto generate password for my application that means when user forget his password when he clicks a link it will auto...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.