Nested datasheets and scrollbars that don't show up

K

kiln

I have nested datasheets inside a subform control - that is, there is a
main form, with a subform control, and in that is a form that is only
allowed to run as a datasheet, and it has a subdatasheet. What's not
good is that the verticle scrollbar for the parent datasheet does not
show up most of the time. The reason for the missing scrollbar seems to
be tied to the fact that there are only a couple of records in the
parent datasheet, and Access decides that it does not need to "enable"
vertical scrollbars for this form since the records easily fit inside
the subform. However trouble starts when the subdatasheets are expanded,
they have more records and soon the need for a verticle parent datasheet
scrollbar is needed.

The best I've come up with it to make the subform control very short at
design time, so that on form open, the scrollbar is determined to be
needed, then programatically increase the height of the control. But
this solution only works sporadically, I'm not sure why. Any ideas would
be of interest.
 
K

kiln

My new approach is to have the parent subform set to form view (not
datasheet) at open, so that it forces scrollbars. But I can't get the
basic actions to work. If I use either

subForm.SetFocus
subForm!VersionID.SetFocus
RunCommand acCmdDatasheetView
or
subForm.SetFocus
subForm!VersionID.SetFocus
RunCommand acCmdDatasheetView

the main form, the one hosting the subform control, does into
datasheet. That's not supposed to be happening. Code is running from the
main form. If I try to use RunCommand acCmdDatasheetView from inside the
subform, I get error 2174: You can't switch to a different view at this
time, code is executing etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top