If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
=RowNum([form]) problem
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 |
#2
|
|||
|
|||
=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 |
#3
|
|||
|
|||
=RowNum([form]) problem
Jeanette,
Your response triggered me to look at two things: I went to the form and changed auto correct to NO and then ordered the report's sort order on the field that seemed to be changing. I think that will work. Thanks! Bob "Jeanette Cunningham" wrote: 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 |
Thread Tools | |
Display Modes | |
|
|