Elsewhere in the code a search is performed, based on some criteria. When a record is found that matches the criteria the bookmark is stored in varEquipRecord(8)- I only allow 8 records (my Base is set to 1), if there are more found the user is notified that there may be a problem with the database as only 8 records *should* be found. In any case, each of these records is then displayed on a subform. So when the user hits the delete button associated with a subform # that # is passed to the sub. Then I refresh the search - and the record shows up again.
When I comment out the search refresh, and just open the table, the record still exists...
Here's the code for the search:
Private Sub FindPriorRecords()
Dim counter As Integer 'holds the value of the total number of records found to match
Dim flag As Integer
Dim rst As Recordset
ClearAllData 'this clears all of the previously shown data and labels on the subforms
counter = 1
'this next section creates a recordset based on the RawResults table. it then scans the
'recordset to find results that match the settings on the controls.
'when a record is found, the bookmark is stored to the EquipRecord array.
'later this bookmark will be used to lookup the results in the RawResults table
Set rst = New ADODB.Recordset
rst.Open "RawResults", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTable
With rst
.Find "Date = " & Me!txtDate
Do While Not .EOF 'while the search has not reached the end of the recordset continue looking
If CInt(Me!cmbEvent.Column(0)) = rst!EventID Then
If CInt(Me!cmbSession) = rst!Session Then
If counter < 9 Then
'do something
varEventRecord(counter) = rst.Bookmark
Me.Bookmark = rst.Bookmark
'set previously stored values
errorflag = 0 ' this is used by the following routine
SetHistoricalSplitData counter
flag = 1
counter = counter + 1
Else
Errorwindow "Error in database: too many records. Please review."
.MoveLast
End If
End If
End If
.Find "EventID = " & Me!cmbEvent.Column(0), 1
Loop
End With
If flag = 0 Then
'if no records were found then clear the old bookmarks
counter = 1
While counter < 9
varEventRecord(counter) = 0
counter = counter + 1
Wend
Else
'if records are found, set the number of subforms to display and update the display
Me!comboNumEquip = counter - 1
UpdateNumEquip
End If
rst.Close
Set rst = Nothing
Exit Sub
Err_FindPriorRecords:
MsgBox Err.Description
Exit_FindPriorRecords:
rst.Close
Set rst = Nothing
End Sub