Access - Open form in new tab
Solved
klrblz
Posted messages
265
Status
Member
-
JustinAmani Posted messages 2 Status Member -
JustinAmani Posted messages 2 Status Member -
Hello,
I would like to know if it is possible to configure a form to open on a specific tab (opening via a control button).
Second small question, is it possible to configure my database in such a way as to open a particular form when the document is opened.
Thanks in advance
Klr
(I am using Office 2007)
I would like to know if it is possible to configure a form to open on a specific tab (opening via a control button).
Second small question, is it possible to configure my database in such a way as to open a particular form when the document is opened.
Thanks in advance
Klr
(I am using Office 2007)
Configuration: Windows XP Internet Explorer 6.0
7 answers
-
Well then, you just need to ask the right question :-)))
In your button, after opening the form, add:
forms![établissements]!nom_de_l_onglet.value = 1 (for the second page of the tab, for example).
The square-bracketed 'établissements' is there to avoid interfering with ACCESS because of the accents. More generally, this is something to do when using 'exotic' characters in object names (spaces and other fun stuff...).
Would that work?
--
A+ Blux"Les cons, ça ose tout. C'est même à ça qu'on les reconnaît"
-
Hi,
1- Do you want to open a form and position yourself on a particular tab? In that case, you put a little code in the open event of your form, something like:
me.nom_de_l_onglet.value = n (where n ranges from 0 to the number of pages of the tab minus 1, 0 being the leftmost page...)
2- http://www.commentcamarche.net/forum/affich 2780341 access lancement formulaire au demarrage
--
A+ Blux
"Les cons, ça ose tout. C'est même à ça qu'on les reconnaît" -
Thank you very much
The 2 works like a charm
For the 1, I'm sorry but I'm terrible at vb, could you tell me where to put the snippet you indicated, here’s the one that opens the right form:
Private Sub bt-resto_click()
DoCmd.openform"établissements", acnormal
End sub
The tab I would like is named "restauration", it has number 2
It would be really cool... -
In your 'establishments' creation form, you click on Properties, go to the 'Event' tab, click on the line 'on open', then in the dropdown that appears at the end of the line select '[Procedural Event]', then you type this code:
me.restauration.value = 2
But it is likely that you are confusing the label of the 'page of the tab' with the name of your 'tab object', in which case the name 'restauration' might not be correct and the number may be incorrect (perhaps 1, for the second page of the tab).
--
A+ Blux"Les cons, ça ose tout. C'est même à ça qu'on les reconnait"
-
Okay okay, in fact I misspoke, so this solution (though very simple) doesn’t satisfy me.
I have a "home" form (report question 2 from earlier), on it I have buttons (the ones I want to program to open my "establishments" form)
The snag is that several buttons on the home lead to the "establishments" form, but on different tabs. I cannot therefore use your method which, correct me if I’m wrong, only programs the opening of the "establishments" form on a particular tab.
I’m therefore looking to put code on the buttons on the home: the code I sent you, I can’t add a line or a criterion saying on which tab to open?
Thank you again for your help -
Execution error 438 Property or method not supported by this object
Private Sub bt_resto_Click()
DoCmd.OpenForm "établissements", acNormal
Forms! [établissements]!Restauration.value = 2
End Sub
It highlights the line Forms!... in yellow-
Surely, as I mentioned above, you confuse the name you gave to a page of your tab object with the tab itself. You need to find the object’s name. Click on the tab in creation mode to select it, then double-click next to the list of pages that compose it (where there are no more tab pages, but still on the object itself). A window titled 'Tab Control: tab_name' will appear. It is this name that must be put into the code. This should work. -- A+ Blux "Les cons, ça ose tout. C'est même à ça qu'on les reconnaît"
-
-
-
YES!! It works great
A big thank you for your patience, your explanations, and for the other post as well (attachments in Access). It really helps me move forward.
Have a good rest of the day.