resizing subforms

J

Jeff

I have a subform that I want to resize when a specified amount of records
appears on it. I do not want vert. scroll bars. Any ideas?
 
G

Graham Mandeno

Hi Jeff

I take it the subform is in "continuous form" view?

All you need to do is change the height of the subform control on the parent
form.
 
J

Jeff

Graham,
Thanks for the reply...
OK, this seems simple enough although I want the subform control height to
be determined from the number of records that it holds. I think I can figure
this out if I just knew how to retrieve the number of records. The
RecordCount property might be an avenue that would work but I don't know to
retrieve the number from a recordset that is created within the parent form.
Below is the code that sets the RecordSource for the subform. How do I get
the RecordCount from this recordset??
I hope I explained this clearly enough....Thanks, Jeff

frm.RecordSource = "SELECT
MeetingDate,meetingid,Clientid,EmployeeFullName,ClientFullName,StartTime,End
Time FROM qry_Union_Single_Weekly_Monthly WHERE meetingDate = #" &
CStr((DayOfMonth)) & "/" & Format(Me.txb_Month, "mmm/yyyy") & "#"


Graham Mandeno said:
Hi Jeff

I take it the subform is in "continuous form" view?

All you need to do is change the height of the subform control on the parent
form.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Jeff said:
I have a subform that I want to resize when a specified amount of records
appears on it. I do not want vert. scroll bars. Any ideas?
 
G

Graham Mandeno

Hi Jeff

You can get the RecordCount from the subform's RecordsetClone:

iRecCount = Me![subform control name].Form.RecordsetClone.RecordCount

You can also get the height of the header, footer and detail sections at
runtime and use them in your calculations. You will need to make
adjustments for dividing lines and navigation buttons (if you have them).
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Jeff said:
Graham,
Thanks for the reply...
OK, this seems simple enough although I want the subform control height to
be determined from the number of records that it holds. I think I can figure
this out if I just knew how to retrieve the number of records. The
RecordCount property might be an avenue that would work but I don't know to
retrieve the number from a recordset that is created within the parent form.
Below is the code that sets the RecordSource for the subform. How do I get
the RecordCount from this recordset??
I hope I explained this clearly enough....Thanks, Jeff

frm.RecordSource = "SELECT
MeetingDate,meetingid,Clientid,EmployeeFullName,ClientFullName,StartTime,End
Time FROM qry_Union_Single_Weekly_Monthly WHERE meetingDate = #" &
CStr((DayOfMonth)) & "/" & Format(Me.txb_Month, "mmm/yyyy") & "#"


Graham Mandeno said:
Hi Jeff

I take it the subform is in "continuous form" view?

All you need to do is change the height of the subform control on the parent
form.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Jeff said:
I have a subform that I want to resize when a specified amount of records
appears on it. I do not want vert. scroll bars. Any ideas?
 
J

Jeff

Graham,
Thanks for the help...works great!

Graham Mandeno said:
Hi Jeff

You can get the RecordCount from the subform's RecordsetClone:

iRecCount = Me![subform control name].Form.RecordsetClone.RecordCount

You can also get the height of the header, footer and detail sections at
runtime and use them in your calculations. You will need to make
adjustments for dividing lines and navigation buttons (if you have them).
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Jeff said:
Graham,
Thanks for the reply...
OK, this seems simple enough although I want the subform control height to
be determined from the number of records that it holds. I think I can figure
this out if I just knew how to retrieve the number of records. The
RecordCount property might be an avenue that would work but I don't know to
retrieve the number from a recordset that is created within the parent form.
Below is the code that sets the RecordSource for the subform. How do I get
the RecordCount from this recordset??
I hope I explained this clearly enough....Thanks, Jeff

frm.RecordSource = "SELECT
MeetingDate,meetingid,Clientid,EmployeeFullName,ClientFullName,StartTime,End
Time FROM qry_Union_Single_Weekly_Monthly WHERE meetingDate = #" &
CStr((DayOfMonth)) & "/" & Format(Me.txb_Month, "mmm/yyyy") & "#"


Graham Mandeno said:
Hi Jeff

I take it the subform is in "continuous form" view?

All you need to do is change the height of the subform control on the parent
form.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have a subform that I want to resize when a specified amount of records
appears on it. I do not want vert. scroll bars. Any ideas?
 

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