insert record number in form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am trying to create a button, that once clicked will add a new record and
rename a text field to the record number. I have the form complete except
for the add record button. Ideally it should create a new form and name the
text field to the record number. can anyone help me with the macro
programming for this? thanks
 
Sorry, I can't make any sense out of your question. A column has the same
name for every record so you could not change its name for a specific
record. Also, a relational table doesn't support the concept of "record
number". The position of a record in a recordset is determined solely by
ordering a query. Older flat file systems used record numbers and that may
be what is confusing you. Excel also shows record numbers. The closest
thing that you will find in a relational table is an autonumber. An
autonumber is uniquely assigned to each record as it is added and doesn't
change no matter how the recordset is sorted. An autonumber is always
unique but it does not need to be contiguous or even sequential.
 
1. Look in Access Help for the GoToRecord method.

2. Look in Access Help for the DMax() function. You'll want to get
the highest value in the field in the entire recordset, add 1 to it
and write that new number into the textbox. When your record is saved
the new number becomes the new max.

HTH
 
Back
Top