JohnB
2007-11-10 00:45:34 UTC
I've tried searching the internet in a variety of ways to get this one, but
can't find it. I have a continuous form that opens at first with no records
and the Detail section's visible property set to No. The user selects a
criteria from the combo box (e.g., cboCriteria) in the header, the
after_update event of which goes something like this:
lngID=me.cboCriteria
strSQL="SELECT * FROM tblMyTable WHERE ID=" &
lngID
me.recordsource=strSQL
me.Detail.visible=true
docmd.RunCommand acCmdSizeToFitForm
The above code does NOT seem to change the size of the form. What I
want to happen, if this is possible, is for the form to expand or shrink
depending on the number of records to be displayed in the Detail section,
and for the area displaying the data to grow or shrink each time the user
selects a new value from the combo box. The number of records to be
returned after each selection from the combo box varies only from 0 to 18,
so the form only needs to expand or shrink a few inches of screen height.
Is this possible?
I have wondered about this for years, and usually just find a way around it.
But now I just want to know. Thanks. --John
can't find it. I have a continuous form that opens at first with no records
and the Detail section's visible property set to No. The user selects a
criteria from the combo box (e.g., cboCriteria) in the header, the
after_update event of which goes something like this:
lngID=me.cboCriteria
strSQL="SELECT * FROM tblMyTable WHERE ID=" &
lngID
me.recordsource=strSQL
me.Detail.visible=true
docmd.RunCommand acCmdSizeToFitForm
The above code does NOT seem to change the size of the form. What I
want to happen, if this is possible, is for the form to expand or shrink
depending on the number of records to be displayed in the Detail section,
and for the area displaying the data to grow or shrink each time the user
selects a new value from the combo box. The number of records to be
returned after each selection from the combo box varies only from 0 to 18,
so the form only needs to expand or shrink a few inches of screen height.
Is this possible?
I have wondered about this for years, and usually just find a way around it.
But now I just want to know. Thanks. --John