Can't use SetFocus

D

Don

I'm using Access 2007. I have a form in which I have a bound text box in the
form header called ENTER_PASSWORD. On the forms On Open Property, I have
entered the following code: Me.ENTER_PASSWORD.SetFocus

In a previous version of Access, this works. In this case, I get the
following error:

Microsoft Office Access doesn't allow you to use this method in the current
view.

Can someone tell me what I've done wrong?
 
R

ruralguy via AccessMonster.com

Unless things have changed, the Open event is too early to reference a
control on the form. You need to use the OnLoad event. The text of the error
could be misleading. ;)
 
R

ruralguy via AccessMonster.com

Thanks for posting back Don.
I apologize for wasting your time. I had my default form view set for a
PivotTable.
I'm using Access 2007. I have a form in which I have a bound text box in the
form header called ENTER_PASSWORD. On the forms On Open Property, I have
[quoted text clipped - 7 lines]
Can someone tell me what I've done wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top