Hi Guys
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 cmdLinkExisting CaredFor_Click produces an Error 6: Overflow error.
Can anyone help me as to what maybe making the code fall down?
Any help would be much appreciated - was just trying to do someone a favour but got in a little over my head!!!
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 cmdLinkExisting CaredFor_Click produces an Error 6: Overflow error.
Can anyone help me as to what maybe making the code fall down?
Code:
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
Comment