By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,471 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,471 IT Pros & Developers. It's quick & easy.

Names of textboxes on tab-pages within a tab control?

P: n/a
MLH
I have a tab control named TabCtl210. It has 3 tabs.
named Page211, Page212 and Page213. Each of
those 3 tab-pages has a textbox control named
Page1HomeSpot, Page2HomeSpot and Page3HomeSpot
respectively.

I got an error #2109: "There is no field named Page1HomeSpot
in the current record"

There's only one line of code in the entire form module that
references the control:

Private Sub Page1()
DoCmd.GoToControl ("Page1HomeSpot")
End Sub

Under what circumstances would Access give em this error?
Aug 25 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Try:
Me.Page1HomeSpot.SetFocus

If that still fails, and you are certain you have a text box with that name
on your form, it sounds like Access is confused about the names. Try this
sequence:
1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact/Repair

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access (holding down the Shift key if you have any startup code),
and compact again.

5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

6. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, inconsistencies between the text- and
compiled-versions of the code are fixed, reference ambiguities are resolved,
and the code syntax is compilable.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.netwrote in message
news:o7********************************@4ax.com...
>I have a tab control named TabCtl210. It has 3 tabs.
named Page211, Page212 and Page213. Each of
those 3 tab-pages has a textbox control named
Page1HomeSpot, Page2HomeSpot and Page3HomeSpot
respectively.

I got an error #2109: "There is no field named Page1HomeSpot
in the current record"

There's only one line of code in the entire form module that
references the control:

Private Sub Page1()
DoCmd.GoToControl ("Page1HomeSpot")
End Sub

Under what circumstances would Access give em this error?

Aug 25 '06 #2

P: n/a
MLH
Thank-you, Allen. I'll give that a try.

It doesn't happen all the time. But it
did happen once and it was fairly
alarming.
Aug 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.