[AccessD] Row number in form

Gustav Brock Gustav at cactus.dk
Tue Jan 22 10:44:23 CST 2008


Hi Charlotte

It's up to you, but I think it mainly would be for display in a form. Even if you have to browse records in list view, you can easily see - when you enter a new record - which number it has without having to display the native record navigator bar.
If you delete records, however, you'll get into trouble as the numbering of existing records may be false while any new record will be numbered correctly. If so, the records could be renumbered by one cycle through the RecordsetClone of the form.

/gustav

>>> cfoust at infostatsystems.com 22-01-2008 17:27:50 >>>
But what purpose does it actually serve?  Wouldn't a CreatedBy and
CreatedDate field make more sense?

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, January 22, 2008 7:09 AM
To: accessd at databaseadvisors.com 
Subject: Re: [AccessD] Row number in form

Hi Susan

It does, in fact it _is_ that record number.

You can use it in a multi-user environment if you don't rely on it as a
kind of unique Id as you may get duplicate entries in the table behind
for this field.

/gustav

>>> ssharkins at gmail.com 22-01-2008 15:59:32 >>>
So, this displays a record number, similar to the form's navigational
toolbar? I'm not why you'd need anything extra in a multi-user
environment -- wouldn't this rely on the form's recordset and not the
data source?

Susan H.


> Hi all
>
> If you in a form wish to store a row number in records added, I found 
> an extremely simple method I haven't seen anywhere else:
>
>  Private Sub Form_BeforeInsert(Cancel As Integer)
>    Me!RowNo.Value = Me.CurrentRecord
>  End Sub
>
> Of course, in a multi-user environment, this must somehow be isolated 
> for a single user's entries.
>
> /gustav





More information about the AccessD mailing list