Access 2003; PC with Windows XP; SBS 2003
I tried searching the forums but it came up with a blank page.
I searched Google and found an answer; but the 'problem' doesn't relate to our situation!
We have a table with 24 fields; 1 AutoNumber; 1 Yes/No; 1 Memo; 2 Currency; 5 Number and the rest Text.
The AutoNumber (PK), one Text (No Duplicatess) and one of the Number fields (Duplicates OK) are indexed.
There is a form to add records to this table with a combo box 'Not In List' event to add the new text to the indexed Text field.
Occasionally (4 times so far; in maybe 2 months) the new record doesn't enter properly and when I try to delete it, I get an error message.
I've read that this usually means an index on a memo field; but as I showed above, no indexed memos. And at the point of adding, there is no text in the memo field at all! (That plus I have no idea what an ISAM seek is; I'm going to hunt as soon as I finish this post)
The only way I can delete the record is by compact and repairing; which in a production environment means kicking everyone out of the database (FE/BD), fixing it, and letting them back in. Not good as lost time = lost sales. Other than that it's a case of leave it till the next day (I auto compact the DB after it's been backed up) and delete it in the morning, which means that the item in question doesn't get put on our database/website until the next day. Again could be lost sales.
Not only do I get the error message, I get a load of gibberish inserted in random fields. The AutoNumber jumped from the 23000 it should be, to 877085005, one of the currency fields suddenly had a value of over £30mil etc.
Does anyone know where I can find more information about this error; or know what I can do to solve it once and for all?
Thanks
Mandi
[ Edit: ]
This is the code behind the new data event for the combo box. I didn't write it, it was there before I got here.
I tried searching the forums but it came up with a blank page.
I searched Google and found an answer; but the 'problem' doesn't relate to our situation!
We have a table with 24 fields; 1 AutoNumber; 1 Yes/No; 1 Memo; 2 Currency; 5 Number and the rest Text.
The AutoNumber (PK), one Text (No Duplicatess) and one of the Number fields (Duplicates OK) are indexed.
There is a form to add records to this table with a combo box 'Not In List' event to add the new text to the indexed Text field.
Occasionally (4 times so far; in maybe 2 months) the new record doesn't enter properly and when I try to delete it, I get an error message.
Code:
The search key was not found in any record. (Error 3709) This error occurs when an ISAM SEEK is being executed and there are no matching values in the index.
The only way I can delete the record is by compact and repairing; which in a production environment means kicking everyone out of the database (FE/BD), fixing it, and letting them back in. Not good as lost time = lost sales. Other than that it's a case of leave it till the next day (I auto compact the DB after it's been backed up) and delete it in the morning, which means that the item in question doesn't get put on our database/website until the next day. Again could be lost sales.
Not only do I get the error message, I get a load of gibberish inserted in random fields. The AutoNumber jumped from the 23000 it should be, to 877085005, one of the currency fields suddenly had a value of over £30mil etc.
Does anyone know where I can find more information about this error; or know what I can do to solve it once and for all?
Thanks
Mandi
[ Edit: ]
This is the code behind the new data event for the combo box. I didn't write it, it was there before I got here.
Code:
Private Sub Combo38_NotInList(NewData As String, Response As Integer)
Dim Db As DAO.Database
Dim Rs As DAO.Recordset
Dim msg, NewID As String
On Error GoTo Err_CustomerID_NotInList
'Exit this subroutine if the combo box was cleared.
If NewData = "" Then Exit Sub
'Confirm that the user wants to add the new customer.
msg = "'" & NewData & "' is not in the list." & vbCr & vbCr
msg = msg & "Do you want to add it?"
If MsgBox(msg, vbQuestion + vbYesNo) = vbNo Then
'If the user chose not to add a customer, set the Response
'argument to suppress an error message and undo changes.
Response = acDataErrContinue
'Display a customized message.
MsgBox "Please try again."
Else
'If the user chose to add a new customer, open a recordset
'using the Customers table.
Set Db = CurrentDb
Set Rs = Db.OpenRecordset("Parts", dbOpenDynaset)
'Create a new record.
Rs.AddNew
'Assign the NewID to the CustomerID field.
Rs![Part No] = NewData
'Save the record.
Rs.Update
'Set Response argument to indicate that new data is being added.
Response = acDataErrAdded
End If
Exit_CustomerID_NotInList:
Exit Sub
Err_CustomerID_NotInList:
MsgBox Err.Description
Response = acDataErrContinue
End Sub
Comment