VBA code not working ni Access 2007 Beta

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

Guest

I am working through Julitta Korol's Access 2000 programming by example. I
have Office 2007. I made the folder with northwind a trusted location and am
trying to do the very first exercise which is to make ContactName in the
Customers form change backcolor on Got Focus. I have entered
Private Sub
ContactName_GotFocus()
Me.ContactName.BackColor = 65280
End Sub as requested through the GotFocus Event and nothing happens when the
cusor goes into contactName. Please help as I want to learn this stuff. I am
a good access user with some knowledeg of event etc but I just want to work
through the book and not miss anything but I can't even start. I've been
advised to go to a beta Office 2007 newsgroup but I can't find one.
 
Did you set the text box's On Got Focus property to:
[Event Procedure]
Then click the Build button (...) beside this.

It does work in A2007.
 
Yes - that is how I got to write the code. It doesn't even do anything when I
use the same example with the prepared example that came with the book.


Allen Browne said:
Did you set the text box's On Got Focus property to:
[Event Procedure]
Then click the Build button (...) beside this.

It does work in A2007.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

nigccbh1 said:
I am working through Julitta Korol's Access 2000 programming by example. I
have Office 2007. I made the folder with northwind a trusted location and
am
trying to do the very first exercise which is to make ContactName in the
Customers form change backcolor on Got Focus. I have entered
Private Sub
ContactName_GotFocus()
Me.ContactName.BackColor = 65280
End Sub as requested through the GotFocus Event and nothing happens when
the
cusor goes into contactName. Please help as I want to learn this stuff. I
am
a good access user with some knowledeg of event etc but I just want to
work
through the book and not miss anything but I can't even start. I've been
advised to go to a beta Office 2007 newsgroup but I can't find one.
 
Nigccbh1,

Maybe a silly suggestion, but then such things have happened before...
Is the Back Color property of the ContactName already set to 65280? If
so you won't see any change when it receives the focus. Similarly, is
its Back Style property set to Transparent?
 
Nigccbh1 -

To amplify Steve's hint, unless your code changes the BackColor property to
some other value than 65280 when the focus is removed from the textbox, the
code that you're running will work only the first time (assuming, as Steve
notes, that the BackColor property starts with a value other than 65280).
 
Back
Top