473,480 Members | 1,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Autonumber field and some more

1. question
when i have custom autonumber field... like Nz(DMax("ClanID",
"tblClanovi")+1 how can i make it try again if someone else pressed the save
button and that namber is already taken,..?? this i need for let say
multiple users running the frontend in access 2002/3 aplication and making
invoices (invoice number is uniq number... and it should only be generated
after presing a save and print button...) now i'm using this code but in
testing phase while i'm building the app it works but i know it wont work as
it should in production enviroment...

me!txtInoviceNo = Nz(DMax("InoviceID", "tblInvoices")) + 1
DoCmd.RunSQL ("INSERT INTO tblInvoices (InoviceID, SomeValue) VALUES (" &
Nz(DMax("InvoiceID", "tblInvoices")) + 1 & "," & "'" & Me!txtSomeField& "'"
& ")")
2. question
after using the same line of code how can i get the value of access (2002)
autonumber after insert into...
so when i append a record it gets its id ... i need this for one of my old
aplication.. that i'm rebuilding but i cant change the way its done on sql
server.. it hase to stay the same..
i need id of this field to print a report with that id -....
Nov 12 '05 #1
0 1201

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2820
by: Jan Hendrickx | last post by:
Hi all, I use (something like) following code to add new records to a database, but it doesn't work!!! I need to know the value of an AutoNumber-field when I add the record. Why doesn't it...
33
4235
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
35
7236
by: Traci | last post by:
If I have a table with an autonumber primary key and 100 records and I delete the last 50 records, the next record added would have a primary key of 101. Is there any way to have the primary key...
26
3763
by: jimfortune | last post by:
Sometimes I use Autonumber fields for ID fields. Furthermore, sometimes I use those same fields in orderdetail type tables. So it's important in that case that once an autonumber key value is...
4
7729
by: Apple | last post by:
1. I want to create an autonumber, my requirement is : 2005/0001 (Year/autonumber), which year & autonumber no. both can auto run. 2. I had create a query by making relation to a table & query,...
6
6219
by: HS1 | last post by:
Hello I have a table in Access Database. This table has a AutoNumber field. I use a DataGrid to show that table When I insert a new record in for this table using a DataGrid, there is a...
1
5527
by: jason.teen | last post by:
Hi, Curerntly I have designed my table in MS Access with a column of "RuleID" and is set to (autonumber) tblRule: RuleID | Name ------------------------------- 1 ...
11
4467
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
9
11204
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
9
5664
by: Gogo | last post by:
Database has record 59 showing, tabing to enter data returns autonumber to 134. What happened to cause this, how would I fix it?
0
7041
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
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
6929
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
5337
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
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.