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?
[CODE=vb]Private Sub cmdLinkExisting CaredFor_Click( )
On Error GoTo Err_cmdLinkExis tingCaredFor_Cl ick
Set dbs = CurrentDb
Set rst = dbs.OpenRecords et("SELECT * FROM tblPeople " & _
"WHERE tblPeople.Perso nType = 'Cared For' OR tblPeople.Perso nType = 'Both' ")
If rst.RecordCount > 0 Then
Me.Tag = Me.CurrentRecor d
stLinkCriteria = "[CarerID]= " & Me.PersonID
stDocName = "frmExistingCar edForByCarer"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.txtForeName & " " & Me.txtFamilyNam e
Else
MsgBox "There are NO 'Cared Fors' in the database."
End If
Exit_cmdLinkExi stingCaredFor_C lick:
Exit Sub
Err_cmdLinkExis tingCaredFor_Cl ick:
Call LogError(Err.Nu mber, Err.Description , Me.Name, "cmdLinkExistin gCaredFor_Click ")
Resume Exit_cmdLinkExi stingCaredFor_C lick
End Sub[/CODE]
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=vb]Private Sub cmdLinkExisting CaredFor_Click( )
On Error GoTo Err_cmdLinkExis tingCaredFor_Cl ick
Set dbs = CurrentDb
Set rst = dbs.OpenRecords et("SELECT * FROM tblPeople " & _
"WHERE tblPeople.Perso nType = 'Cared For' OR tblPeople.Perso nType = 'Both' ")
If rst.RecordCount > 0 Then
Me.Tag = Me.CurrentRecor d
stLinkCriteria = "[CarerID]= " & Me.PersonID
stDocName = "frmExistingCar edForByCarer"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.txtForeName & " " & Me.txtFamilyNam e
Else
MsgBox "There are NO 'Cared Fors' in the database."
End If
Exit_cmdLinkExi stingCaredFor_C lick:
Exit Sub
Err_cmdLinkExis tingCaredFor_Cl ick:
Call LogError(Err.Nu mber, Err.Description , Me.Name, "cmdLinkExistin gCaredFor_Click ")
Resume Exit_cmdLinkExi stingCaredFor_C lick
End Sub[/CODE]
Any help would be much appreciated - was just trying to do someone a favour but got in a little over my head!!!
Comment