View Single Post
  #2  
Old August 11th, 2009, 09:57 PM posted to microsoft.public.access.tablesdbdesign
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default =RowNum([form]) problem

Hi Bob,
it sounds as if the filter of the form has changed between the time you
first look at the row numbering and the time that you go back to that form.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"Bob Waggoner" wrote in message
...
Our slit check database - (we check the slit widths on material running
through our machine) we have the form set up so that numbering is handled
by
the =RowNum([form]) function. Code is from Stephen Lebans (C) 1999. It was
updated by Chris Bergmans...
Public Function RowNum(frm As Form) As Variant
On Error GoTo Err_RowNum
'Purpose: Numbering the rows on a form.
'Usage: Text box with ControlSource of: =RowNum([Form])

With frm.RecordsetClone
.Bookmark = frm.Bookmark
RowNum = .AbsolutePosition + 1
End With

Exit_RowNum:
Exit Function

Err_RowNum:
If Err.Number 3021& Then 'Ignore "No bookmark" at new row.
Debug.Print "RowNum() error " & Err.Number & " - " &
Err.Description
End If
RowNum = Null
Resume Exit_RowNum
End Function

My problem is, if I leave the record and go back to it later, the records
are scrambled - not the numbering - that still is 1-10, for example, but
the
records associated with that row number have moved. Record 1 might be
record
3 or 4 now.

How do I keep this from happening? It started when we converted from
Access
97 to Access 2003.

Help, please!
Bob