[AccessD] Change code to A2003 - function error SOLVED

Bob Gajewski rbgajewski at adelphia.net
Fri Jun 11 10:03:25 CDT 2004


Bobby

You're a genius! Worked like a charm.

Thanks!!!

Bob Gajewski

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Bobby Heid
Sent: Friday, June 11, 2004 11:00
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Change code to A2003 - function error


Off of the top of my head, I would try

On got focus     =cbfGotFocus()
On Lost Focus    =cbfLostFocus()

HTH,
Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bob Gajewski
Sent: Friday, June 11, 2004 10:18 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Change code to A2003 - function error


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


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list