[AccessD] Change code to A2003 - function error

Bob Gajewski rbgajewski at adelphia.net
Fri Jun 11 09:18:01 CDT 2004


Dear List:

I am having a problem with an A2003 db. Since I have just
upgraded to this version, I am still rather new on the
quirks/changes, so please bear with me. 

I have a user-defined function so that each field is 
"high-lighted" when it has focus, to assist the user
in following the data input screen.

In my form's CBF (frmJobs), I have the following code:

Option Compare Database
Option Explicit
-------------------------------------------------------
Function cbfGotFocus()
  Me.ActiveControl.BackColor = 8454143
End Function
-------------------------------------------------------
Function cbfLostFocus()
  If Me.ActiveControl.Name <> "cboAll" Then
    Me.ActiveControl.BackColor = vbWhite
  End If
End Function
-------------------------------------------------------

In each field's properties, I have:

On Got Focus     =[cbfGotFocus]
On Lost Focus    =[cbfLostFocus]

This has been working perfectly for my A97 and A2K db's.
Now that I have converted this one db to A2003, I keep
getting the error: 

'The expression On Got Focus you entered as the event
property setting doesn't contain the automation object
'cbfGotFocus'.

I have Jet 4.0 SP8 installed. There is no custom security
installed; no db password. The following references are
checked:
  Visual Basic for Applications
  Microsoft Access 11.0 Object Library
  OLE Automation
  Microsoft ActiveX Data Objects 2.1 Library
  Microsoft DAO 3.6 Object Library

As always, TIA!

Bob Gajewski





More information about the AccessD mailing list