View Full Version : Problem with GotFocus


LQ
10-03-2001, 03:54 AM
There are certain fields on one of my forms where I had to set up a manual tab order (because the fields are on different tabs and sections of the form, I couldn't just drag and drop using Tab Order). I did this like this:

Private Sub cboCMstatus2_LostFocus()
Me.cboCMaction.GotFocus
End Sub

This worked for a while. This morning, if I try to tab through the fields I get errors that seem to be centered around GotFocus. The msg says: "Compile error: method or data member not found" and GotFocus is highlighted.

Does anyone know why this is happening? And if not, is there a better way to manually set up a tab order?

Thanks in advance....

Elvis
10-03-2001, 04:46 AM
Hi, I have had this before and found it to be the name of the control thats wrong in the code. Check the name of the control is correct and not spelt incorrectly, no additional spaces etc.

If it used to work and nobody has changed anything then don't know why its not working now.

LQ
10-03-2001, 04:56 AM
Thanks for the suggestion, but the name of the control does not seem to be the problem...and it's happening in several fields. I guess I will try making a new database and importing my form and see if that works. What a pain. And if it doesn't work, I don't know what to do except have a messed-up tab order in that form!

Any other suggestions would be appreciated!

LQ
10-03-2001, 05:08 AM
OK, I tried creating a new database and importing that form, but I'm still getting that error.

I have been frantically reading posts, searching through help, etc. Could this have something to do with a lost library reference? I don't know much about the topic, but I knew enough to check which references I have: Visual Basic for Applications, MS Access 8.0 Object Library, MS DAO 3.51 Object Library (I'm using A97). This seems like it's right to me, but I admittedly don't know much.

Any other ideas?
TIA

[This message has been edited by LQ (edited 10-03-2001).]

LQ
10-03-2001, 06:57 AM
This makes no sense to me...I changed GotFocus to SetFocus and now I'm not getting those error msgs. But this was working before! So I don't quite know where I went wrong, but I'm glad I got it to work again.

Oldsoftboss
11-04-2001, 12:24 AM
Not sure if I,m on the right track. Is the field you are trying to tab to on a different tab page?
If so could you go:
page.setfocus 'to get to the right page
field.setfocus
Hope this helps