I have inherited an Access DB in a very poorly state! I have offered to make some changes to it for a local charity but have got stuck on this error it seems to be creating for all new records.
I am working within a Form which is calling another Form matched on the ID, this is within Access 2000. Clicking the cmdLinkExistingCaredFor_Click produces an Error 6: Overflow error.
Can anyone help me as to what maybe making the code fall down?
Expand|Select|Wrap|Line Numbers
- Private Sub cmdLinkExistingCaredFor_Click()
- On Error GoTo Err_cmdLinkExistingCaredFor_Click
- Set dbs = CurrentDb
- Set rst = dbs.OpenRecordset("SELECT * FROM tblPeople " & _
- "WHERE tblPeople.PersonType = 'Cared For' OR tblPeople.PersonType = 'Both' ")
- If rst.RecordCount > 0 Then
- Me.Tag = Me.CurrentRecord
- stLinkCriteria = "[CarerID]= " & Me.PersonID
- stDocName = "frmExistingCaredForByCarer"
- DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.txtForeName & " " & Me.txtFamilyName
- Else
- MsgBox "There are NO 'Cared Fors' in the database."
- End If
- Exit_cmdLinkExistingCaredFor_Click:
- Exit Sub
- Err_cmdLinkExistingCaredFor_Click:
- Call LogError(Err.Number, Err.Description, Me.Name, "cmdLinkExistingCaredFor_Click")
- Resume Exit_cmdLinkExistingCaredFor_Click
- End Sub