Turn off Visual Basic auto correct

B

Bill Scott

I am trying to add a line of code that starts with the number "1". The line
is automatically correcting itself to be a numbered paragraph.

When I start with the following:

Private Sub FormLoad()

'Move the focus to the list box and then to the first query in the list
1stQueryList.SetFocus

End Sub

the editor automatically converts the "1stQueryList.SetFocus" to
"1 stQueryList.SetFocus" and the rental will not run.

Any suggestions on how I can turn off the auto-correct to stop the first
line from doing this?
Thanks
Bill Scott
 
L

Linq Adams via AccessMonster.com

The problem here is that Access hates object names that starts with digits.

If, in Design View, you go to create an event for 1stQueryList, such as the
OnEnter event, you'll find that Access will add

Ctl

to the beginning of the control's name, in the code window and give you

Private Sub Ctl1stQueryList_Enter()

If you insist on using this name, in your code you'll have to refer to it in
this fashion, using

Ctl1stQueryList.SetFocus

Really far better to use a name like

FirstQueryList
 

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