Ilona-

Sure.  Don't use AutoNumber.  Use Number / Long Integer and write a bit of
code in the BeforeUpdate event of your form to set the PKey to the next
available number.

  ' If about to save a new record
  If Me.NewRecord Then
    ' Create the next key value
    Me.ID = NZ(DMax("ID", "MyTable"), 0) + 1
  End If

John Viescas, author
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
Running Microsoft Access 2000
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
For the inside scoop on Access 2007, see:
http://blogs.msdn.com/access/


-----Original Message-----
From: ms_access@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Ilona Wright
Sent: Monday, April 24, 2006 4:41 PM
To: ms_access@yahoogroups.com
Subject: RE: [ms_access]Autonumber query

Hi John,
I'm glad to see you are back on the list. That's great. I need more help
please.
I am using ACCESS 97.
I have a table for holding assets information and I want the Asset Id
(autonumber) to be the same as the table (physical) record number.

I have discovered that on entering data into a new record via a form, if I
ESC out of the new record the autonumber is updated and my physical record
numbers are no longer in synch with my auto numbers. eg if I have
record number 5 (a new record) and autonumber 5 displays as I enter data, if
I ESC before moving onto a different record, and then start entering data
into record number 5 again, it gives me autonumber 6.

Is there any way I can prevent this from happening?

Is there any way I can change the autonumber of record number 5 to "5"?
Thank you very much in anticipation of your response.
Ilona Wright
Adelaide, Australia



[Non-text portions of this message have been removed]




Yahoo! Groups Links










YAHOO! GROUPS LINKS




Reply via email to