Datasheet form to resize with master form

smercer

Registered User.
Local time
Today, 22:08
Joined
Jun 14, 2004
Messages
442
Hi all

I have a subform in data sheet view, and when the user resizes the master form I want the subform to resize with it. I got it to work but, I want the scroll bars to show with out scrolling the master form to get to them. here is my code:

Code:
[COLOR=Blue]Private Sub[/COLOR] Form_Resize()
[COLOR=Blue]Dim[/COLOR] F_Width [COLOR=Blue]As Integer[/COLOR]
[COLOR=Blue]Dim [/COLOR] F_Height [COLOR=Blue]As Integer[/COLOR]
[COLOR=Blue]Dim[/COLOR] Adjust_Width [COLOR=Blue]As Integer[/COLOR]


F_Width = Form.InsideWidth
Adjust_Width = F_Width - 1
F_Height = Form.InsideHeight

sfrm_Books_Descriptions_in_Store_subform_DatasheetView.Width = Adjust_Width
sfrm_Books_Descriptions_in_Store_subform_DatasheetView.Height = F_Height

[COLOR=Blue]End Sub[/COLOR]
the line
Adjust_Width = F_Width - 1
seems to be ignored by the form and has no effect

Please note that the forum has put spaces in and has no spaces
Thanks to all in advance!!
 
Last edited:
Thanks Pat

It works perfectly now. Well Done!!

Thanks again
 
Please excuse the ignorance. I am trying to learn from the great information provided by Pat and others in this forum.

But where do you insert this code? Is it in the main form or the subform. It's just that I can't see a Event called RESIZE
 
Dylan said:
Please excuse the ignorance. I am trying to learn from the great information provided by Pat and others in this forum.

But where do you insert this code? Is it in the main form or the subform. It's just that I can't see a Event called RESIZE
see attachment. you insert it in the mainform
 

Attachments

  • Resize here.gif
    Resize here.gif
    18.6 KB · Views: 219

Users who are viewing this thread

Back
Top Bottom