Error message: Communicating with the OLE Server or ActiveX Contro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I keep getting this error message:
The expression On Click you entered...a problem occurred while [database
name] was communicating with the OLE server of ActiveX Control. I did a shift
alt f11 and it displayes a 502473 in the bottom right-hand corner of the
messagebox. I'm not sure why this is occuring...

here is the code in question:

Private Sub project_id_Click()
On Error GoTo project_id_Click_Err

On Error Resume Next
If (Form.Dirty) Then
DoCmd.RunCommand acCmdSaveRecord
End If
If (MacroError.Number <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
Exit Sub
End If
On Error GoTo 0
DoCmd.OpenForm "Project - Details", acNormal, "", "[project_id]=" &
Nz(project_id, 0), , acNormal
If (Not IsNull(project_id)) Then
TempVars.Add "CurrentID", "[project_id]"
End If
If (IsNull(project_id)) Then
TempVars.Add "CurrentID",
"Nz(DMax(""[project_id]"",[Form].[RecordSource]),0)"
End If
DoCmd.Requery ""
DoCmd.SearchForRecord , "", acFirst, "[project_id]=" & TempVars!CurrentID
TempVars.Remove "CurrentID"

Please help - thanks
 
Back
Top