A subform question

I

Iconoclast

Is there a way to do this?
I'm trying to make a form wherein there is a textbox to receive a positive
integer. Depending on the value of the integer a subform (datasheet view)
will display an equivalent number of rows that can receive inputs. If the
initial textbox is empty, the subform will be disabled.

Thank you.
 
R

Rick Brandt

Iconoclast said:
Is there a way to do this?
I'm trying to make a form wherein there is a textbox to receive a positive
integer. Depending on the value of the integer a subform (datasheet view)
will display an equivalent number of rows that can receive inputs. If the
initial textbox is empty, the subform will be disabled.

Thank you.

Are you saying you want to adjust the height of the SubForm control such that
'n' rows are visible without scrolling or do you want to see actual
pre-populated rows in the subform?

For the former you would have to first increase the height of the parent form
section that the subform resides in, push everything below the subform control
down by changing the Top property setting and then change the height of the
SubForm control itself. To reduce the height the order of those events would
have to be reversed. You would have to calculate how much to move and resize by
determining the number of twips one row in your subform requires and then
multiplying that by the number of rows needed.

For the latter you would need to execute an append query to add 'n' blank rows
to the table the SubForm is bound to and disable AllowAdditions in that SubForm
so that the user could not add more rows than you provided.
 

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