Does anyone know why this code gives me a debug error when I set my form's "Data Entry" to "Yes"
-------------------------------
Dim rst As Recordset
Set rst = Me.RecordsetClone
'Set a field with the total number of records
Me![Field1] = rst.RecordCount
If (Not Me.NewRecord) Then
rst.Bookmark = Me.Bookmark
'Set a field with the current record number
Me![Field2] = rst.AbsolutePosition + 1
Else
Me![Field2] = -1
End If
-----------------------------------
I am trying to have the form open with all blanks forcing the user to choose an employee from the combobox I have which will autopoulate the rest of the fields once chosen.
The code is a record counter that counts the records in the database and displays it on the Form (example: Record 4 of 6).
Everything works fine until I choose the "Data Entry" and set it to "Yes"
Does anyone know why this is giving me an error?
Please Help!!
Chance~
-------------------------------
Dim rst As Recordset
Set rst = Me.RecordsetClone
'Set a field with the total number of records
Me![Field1] = rst.RecordCount
If (Not Me.NewRecord) Then
rst.Bookmark = Me.Bookmark
'Set a field with the current record number
Me![Field2] = rst.AbsolutePosition + 1
Else
Me![Field2] = -1
End If
-----------------------------------
I am trying to have the form open with all blanks forcing the user to choose an employee from the combobox I have which will autopoulate the rest of the fields once chosen.
The code is a record counter that counts the records in the database and displays it on the Form (example: Record 4 of 6).
Everything works fine until I choose the "Data Entry" and set it to "Yes"
Does anyone know why this is giving me an error?
Please Help!!
Chance~