Setting the position of a subform scrollbar (1 Viewer)

reptar

Registered User.
Local time
Yesterday, 17:31
Joined
Jul 4, 2005
Messages
32
Hi everyone,

I have a 4 part survey database consisting of one source table : tbl_survey. I have created a main form with 4 subforms (each subform is a section from the survey table tbl_survey).

I have placed 4 buttons in the main form, and each button when clicked reveals its subform, whilst hiding the others. So when the main form opens, the first subform is displayed (others are hidden). When the user finishes the first subform, they click on the second button to display the next subform and so on.

My question is, i want to set the verticle scrollbar position of each subform to the very top when its appropriate button is clicked so that if a user goes back to a previous subform, the scrollbar isnt all the way down the bottom.

Reptar
 
Last edited:

RuralGuy

AWF VIP
Local time
Yesterday, 18:31
Joined
Jul 2, 2005
Messages
13,826
I'm pretty sure just requerying the subform will do it. Me.SubFormControl.Form.Requery
 

reptar

Registered User.
Local time
Yesterday, 17:31
Joined
Jul 4, 2005
Messages
32
Thankyou for your response, i have tried this statement but it seems to take the scrollbar position to the first tab stop and not the very top of the subform page when the survey section heading resides...

Any ideas??

Reptar
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:31
Joined
Jul 2, 2005
Messages
13,826
I just tried it on a test db and it worked for me. It puts the recordselector back to the first record in the RecordSet and the scroll bar is back to the top position.
 

reptar

Registered User.
Local time
Yesterday, 17:31
Joined
Jul 4, 2005
Messages
32
Is your textfield at the very top of your subform? Try creating a subform with the first tab stop text field down a little way on the subform page. Then out of the subform, on the form place a button with the following onClick() text applied:Me.SubFormControl.Form.Requery

When the button is pressed, does the textfield go to the very top with the scrollbar down a little?

Reptar
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:31
Joined
Jul 2, 2005
Messages
13,826
I'm not sure what you mean by Tab Stop for a SubForm. Did you use your SubFormControl name in Me.SubFormControl.Form.Requery?
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:31
Joined
Jul 2, 2005
Messages
13,826
Duhh <slapping forehead>,
Is your SubForm displayed as a SingleForm? I was thinking of it as a Continuous form or DataSheet view.
 

reptar

Registered User.
Local time
Yesterday, 17:31
Joined
Jul 4, 2005
Messages
32
Okay nevermind about the tab stop talk...

Place your subform into your form a make sure it big enough to have verticle scrollbars. Place a text heading at the very top and have your first textfield a little way undernieth it. Then outside of the subform, place the button with that onClick() Me.SubFormControl.Form.Requery bit. Does the scroll position go to the first textfield (and cut off the text heading?), or does it remain at the top of the subform page?
 

reptar

Registered User.
Local time
Yesterday, 17:31
Joined
Jul 4, 2005
Messages
32
the subform is disaplyed as a single form... does this change things?
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:31
Joined
Jul 2, 2005
Messages
13,826
Hi reptar,
Yes, single form view does make a difference to the answers. Sorry, it was a stupid assumption on my part. Maybe this sample db from Stephan Lebans will fill the ticket for you.
 

reptar

Registered User.
Local time
Yesterday, 17:31
Joined
Jul 4, 2005
Messages
32
yeh i had already found this database. And i have no idea how to extract what i need from it.

Thanks for your help

Reptar
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:31
Joined
Jul 2, 2005
Messages
13,826
Sorry I couldn't be of more help. Good luck on your quest.
 

Users who are viewing this thread

Top Bottom