473,503 Members | 756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you generate a Autonumber function without the datatype one in ACCESS?

1 New Member
Hi,

I am trying to generate a autonumber function in access without using the Autonumber datatype field. I have limited knowledge of access and I have been advised by looking on the web that I need to use something similar to:

Nz(DMax("val([PalletNo])", "PRODUCTION") + 1)

Where do i put this code? Can any give me steps plz?

Thanks
Dec 12 '07 #1
2 1782
ollyb303
74 New Member
Hi,

I think your question has already been answered on this forum. Try these threads:

Auto Increment and Reset Number Sequence in a Table
Generate Autonumber in Textfield On Form of Access

Good luck :)
Dec 12 '07 #2
missinglinq
3,532 Recognized Expert Specialist
It goes in the code window behind your form. In the Form's Design View, on the menu goto View - Code then paste this in, being sure to erase any line numbers that get pasted as well.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. If Me.NewRecord Then
  3.    Nz(DMax("val([PalletNo])", "PRODUCTION") + 1)
  4. End If
  5. End Sub
  6.  
This way the new number is only generated if the record is a new record. Existing records are ignored.

Welcome to TheScripts!

Linq ;0)>
Dec 12 '07 #3

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

Similar topics

33
4239
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...
8
1875
by: bigbinc | last post by:
I am in autonumber hell, it is important for me to get the AutoNumber even in case of previous deleted records, and I cant get the value through a 'test' insert and then delete method. There is no...
29
3709
by: Lauren Wilson | last post by:
Does anyone know how the following info is extracted from the user's computer by a Front Page form? HTTP User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107...
26
3766
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
3323
by: dhcomcast | last post by:
We're starting to use Oracle for the back-end instead of a separate Access .mdb file for the data and everything as gone surprisingly well so far. We are learning Oracle as we go; Yikes! But we...
11
4468
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...
7
2972
by: jmar | last post by:
I'm hoping someone out there can give me a little guidance. I have an Access Database "Customer.MDB" with a table "CustInfo" that has the following design: Field: DataType CustID AutoNumber...
2
7894
by: shiznaw | last post by:
So, umm. How would you generate an alpha-numeric autonumber each time an end user clicks a field/button on a form without using the autonumber option within a table.
6
11745
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the...
0
7203
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
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
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
7462
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...
1
5014
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...
0
3168
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
1514
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
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
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.