J
Jan Il
Hi all - Access 2002, Windows ME
I am having a time trying to figure out why this code keeps causing the
debugger to balk on compile. The part that keeps being highlighted is the
..EquipID of the code below. Everything else seems to be fine this is the
only thing in the db that causes the compile to object. I have redone this
and reviewed it and gone over the Help files, but, I just can't see where
the problem is.
I have tried changing the Me. to Me!, but, it makes no difference. I have
checked the form, checked the table and the query and all, and everything
seems correct.
I would truly appreciate it if someone would point out where I have made the
mistake in this code.
Regards,
Jan
*****************Start of Code************************
Private Sub SaveRec_Click()
On Error GoTo Err_SaveRec_Click
If DCount("*", "[SignalCaseInspTbl]", "[EquipID]=""" & Me.cmbEquipID & """
And [Qtrly]=#" & Me.Qtrly & "#") = 0 Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer7
DoCmd.GoToRecord , , acNewRec
Me![cmbEquipID].SetFocus
Else
MsgBox "This Record Already Exists", vbExclamation, "Record Already
Exists"
End If
Exit_SaveRec_Click:
Exit Sub
Err_SaveRec_Click:
MsgBox Err.Description
Resume Exit_SaveRec_Click
End Sub
***********************************End Code***************************
I am having a time trying to figure out why this code keeps causing the
debugger to balk on compile. The part that keeps being highlighted is the
..EquipID of the code below. Everything else seems to be fine this is the
only thing in the db that causes the compile to object. I have redone this
and reviewed it and gone over the Help files, but, I just can't see where
the problem is.
I have tried changing the Me. to Me!, but, it makes no difference. I have
checked the form, checked the table and the query and all, and everything
seems correct.
I would truly appreciate it if someone would point out where I have made the
mistake in this code.
Regards,
Jan
*****************Start of Code************************
Private Sub SaveRec_Click()
On Error GoTo Err_SaveRec_Click
If DCount("*", "[SignalCaseInspTbl]", "[EquipID]=""" & Me.cmbEquipID & """
And [Qtrly]=#" & Me.Qtrly & "#") = 0 Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer7
DoCmd.GoToRecord , , acNewRec
Me![cmbEquipID].SetFocus
Else
MsgBox "This Record Already Exists", vbExclamation, "Record Already
Exists"
End If
Exit_SaveRec_Click:
Exit Sub
Err_SaveRec_Click:
MsgBox Err.Description
Resume Exit_SaveRec_Click
End Sub
***********************************End Code***************************