DataBase - VBA to page down in a subform
Asked By KRR
20-Nov-09 06:11 PM
Hi,
I have a tab control in a subform that is twice as long as the subform. When
I hit a certain field in the tab control I want the subform to automatically
page down so the user see's the entire botton half of the tab control
contents.
Is there a way to do this?
Right now when I navigate through the fields fields and get to the bottom
half of the tab control it only shows the field with the focus at the bottom
of the form and nothing below.
Thanks,
Ken
DoCmd.GoToPage
(1)
VBA
(1)
GoToPage
(1)
Database
(1)
ControlName
(1)
LostFocus
(1)
GotFocus
(1)
Pagebreak
(1)
bhicks11 via AccessMonster.com replied to KRR
I think the easiest way to do this would be to set focus to a control at the
bottom of the form and then move focus back up to the control that you were
last in the top of the form on. This should leave with the form's bottom
half in view.
In the control On GotFocus event put:
Me.lastcontrol.setfocus
me.othercontrol.setfocus
Bonnie
http://www.dataplus-svc.com/database_programming.htm
--
Message posted via http://www.accessmonster.com
AccessVandal via AccessMonster.com replied to KRR
You insert a pagebreak control after/before near the last control where you
want to break the page.
In the last control where you break the page, use the on lost focus event
like
Private Sub ControlName_LostFocus()
DoCmd.GoToPage 2 ' go to page 2
End Sub
ControlName is the last control/textbox at the bottom of the page.
If you have more than two page, insert another pagebreak control. Again Docmd.
GoToPage 3.
As you can guess, you can also go back to page 1.
--
Please Rate the posting if helps you.
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1
s'il est possible de déplacer l'ascenseur sur la droite via du code VBA associé à mon bouton "Suite" Merci Access Discussions MonForm.GoToPage (1) DoCmd.GotoPage (1) VBA (1) ScrollBars (1) A9placement (1) Pierre (1) Twips (1) Bonto (1) Salut, On peut dà poser des "sauts de page" sur un formulaire et ensuite utiliser : Forms!MonForm.GoToPage N, X, Y ou bien : Me.GotoPage N, X, Y ou encore : DoCmd.GotoPage N, X, Y ou N représente le numéro de la "page" X
DoCmd.GoToPage 1 DataBase Hall?schen, ich habe in einem Formular eine Register mit 5 Seiten. Nun m?chte ich per Button auf die Seite 3 springen. Dachte das geht mit \ \ DoCmd.GoToPage 2 / / / Bekomme aber eine Fehlermeldung, das ich eine Seitennummer angeben w?rde die es nicht foto.lupusdw.de) Urlaub macht man in Irland: http: / / www.eaglesnest-bb.com / Access Discussions DoCmd.GoToPage (1) DeinRegister.Value (1) GoToPage (1) DeinRegister (1) Seitenumbruchsteuerelement (1) Standardeigenschaft (1) Hallo Lupus, Lupus Goebel schrieb folgendes: Setze den das geht dann. b.) Hat eh einiges an Vorteile. Aber warum geht das mit dem GoToPage nicht? Nur mal aus Neugierde wegen des Lernerfolges ;-) - - MfG - Lupus Goebel Der Sumpf- Morasthobbybastler und
Project Explorer VBA DataBase VBA Why I can's see some forms created in access window in (Project Explorer) in VBA Windows Access Forms Coding Discussions VBA (1) Window (1) Because they do not have a VBA module? - - Marsh MVP [MS Access] thank you Very good answer keywords: Project, Explorer VBA description: VBA Why I can's see some forms created in access window in (Project Explorer) in VBA Windows
you please help me with this code. I am trying to run SQL query from VBA: VBA code: strSQL = "SELECT tblUzorak.IDVrsta, Avg([tblUzorak]![PEN14647_6h]) AS 30A_PEN14647_6h, Avg([tblUzorak]![PEN14647_1d]) AS 30A_PEN14647_1d like 'process1')'. Any help would be great. Thanks in advance. Toni Access Modules DAO Discussions VBA (1) DbsDB.OpenRecordset (1) StrStartDateAsText (1) TblUzorak.IDVrsta (1) StrEndDateAsText (1) ClauseAND (1) FrmStatsitikaOpreme (1 you please help me with this code. I am trying to run SQL query from VBA: VBA code: strSQL = SELECT tblUzorak.I