dbTalk Databases Forums  

setting subform scrollbar based on width

comp.databases.ms-access comp.databases.ms-access


Discuss setting subform scrollbar based on width in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
christianlott1@yahoo.com
 
Posts: n/a

Default setting subform scrollbar based on width - 12-08-2010 , 10:22 AM






"Object doesn't support this property or method" for:
ctl.Form.InsideWidth
Forms!frmmain!frmFormView!(ctl.Name).ScrollBars = 3



Private Sub Form_Resize()

Dim sForm As Access.Form
Set sForm = Forms!frmmain!frmFormView.Form
With sForm
Dim ctl As Control
For Each ctl In .Controls
If (ctl.ControlType = acSubform) Then
If ctl.Form.InsideWidth < .Form.InsideWidth - 80 Then
Forms!frmmain!frmFormView!(ctl.Name).ScrollBars = 3
End If
End If
Next ctl
End With

End Sub



Thanks!

Reply With Quote
  #2  
Old   
christianlott1@yahoo.com
 
Posts: n/a

Default Re: setting subform scrollbar based on width - 12-08-2010 , 10:36 AM






Ok, sorry guys, forget this.

My problem is that my subform vertical bar isn't sizing to fit the
controls in it. In other words, it's not providing enough scroll to
show the child subform and controls. I suspect this has something to
do with the anchoring. Is there a way to fix?

Thanks

Reply With Quote
  #3  
Old   
Marshall Barton
 
Posts: n/a

Default Re: setting subform scrollbar based on width - 12-08-2010 , 10:53 AM



christianlott1 (AT) yahoo (DOT) com wrote:

Quote:
"Object doesn't support this property or method" for:
ctl.Form.InsideWidth
Forms!frmmain!frmFormView!(ctl.Name).ScrollBars = 3

Private Sub Form_Resize()

Dim sForm As Access.Form
Set sForm = Forms!frmmain!frmFormView.Form
With sForm
Dim ctl As Control
For Each ctl In .Controls
If (ctl.ControlType = acSubform) Then
If ctl.Form.InsideWidth < .Form.InsideWidth - 80 Then
Forms!frmmain!frmFormView!(ctl.Name).ScrollBars = 3
End If
End If
Next ctl
End With

End Sub


subform controls do not have a scroll bar. Try this:

If ctl.Form.InsideWidth < .InsideWidth - 80 Then
ctl.Form.ScrollBars = 3
End If

--
Marsh

Reply With Quote
  #4  
Old   
Marshall Barton
 
Posts: n/a

Default Re: setting subform scrollbar based on width - 12-08-2010 , 02:19 PM



christianlott1 (AT) yahoo (DOT) com wrote:

Quote:
Ok, sorry guys, forget this.

My problem is that my subform vertical bar isn't sizing to fit the
controls in it. In other words, it's not providing enough scroll to
show the child subform and controls. I suspect this has something to
do with the anchoring. Is there a way to fix?

It sounds like you set the scroll bar on the wrong thing.
Try what I suggested in my earlier respnse and see if it
helps.

--
Marsh

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.