Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • Hmm... that's the most worrying part, is I've already set it up that way. GotoControl is called from the form with the TabControl1 ('PartDetails'). The page names and subform names autocomplete as well. No Forms reference included, as you said. I'm starting to think this truly is a bug, or exactly as the error says: "The GoToControl cannot be used to go to a subform or tab page in Web forms." Worrying because BrowseTo works perfectly in web, and can swap out subforms entirely. If I had known I could've built similar functionality to TabControl with BrowseTo and a single subform. Commented Jan 20, 2015 at 17:39
  • With further testing I was able to reproduce this error in a fresh database. Start with Access 2010 SP2, and create a new blank web db. No tables required, just create a blank web form with a button and a TabControl with Page0 and Page1. For the button's macro, make it GoToControl=Page1. Save the form and try it out, it should work perfectly. Now before uploading to SharePoint, you will have to set the "Web Display Form" to the one we just created. Now do Publish to Access Services and choose a SharePoint 2010 Server with SP2. Open the DB in web browser, and the button's macro no longer works. Commented Jan 20, 2015 at 17:56
  • Note that the code will work + run in the client side, since controls behind a tab are rendered and exist when the form loads. For a web browser - read my above extended answer - such controls have NOT yet been rendered, and thus goto control will not YET work. Once you displayed that tab, then your code should work since the controls have been rendered and thus are now part of the DOM. Commented Jan 21, 2015 at 20:59
  • Albert — I have tried what you said, and even with the tab Page I'm trying to "GoTo" selected & rendered in browser, I still get the error. I've tried to "GoTo" the TabControl first and then the Page, and even tried placing the code within the TabControl itself. Same error every time. I've updated my answer with steps to reproduce this error for yourself, as well as a sample database that demonstrates it. I understand your answer in theory, but in practice it always fails. Cheers if you can get it to work. Commented Jan 28, 2015 at 20:06
  • You cannot switch the tab via code in web based (and I never suggested you could). So using goto control likely not going to help you much. What I stated is you cannot “reference” the control until it been rendered. However goto and referencing are TWO VERY different issues. So in general you cannot execute the goto control command until such time that tab + control has been displayed. (a VERY big difference). Commented Feb 14, 2015 at 18:49