VScroll does not work with Line added - Run-time error '438'.
Posted on 2006-04-18
I have found a code sample out there that lets me add in a vscroll bar so that I can scroll my form. I'm able to scroll fine, until I added some lines. The error that I'm getting is as followed:
Run-time error '438': Object doesn't support this property or method.
Here's the code and I use and the line where I"m having issues with.
Dim oldPos As Integer
Private Sub Form_Load()
Dim iFullFormHeigth As Integer
Dim iDisplayHeight As Integer
iFullFormHeigth = 12900
iDisplayHeight = 3000
Me.Height = iDisplayHeight
.Height = Me.ScaleHeight
.Min = 0
.Max = iFullFormHeigth - iDisplayHeight
.SmallChange = Screen.TwipsPerPixelY * 10
.LargeChange = .SmallChange
Private Sub pScrollForm()
Dim ctl As Control
For Each ctl In Me.Controls
If Not (TypeOf ctl Is VScrollBar) And _
Not (TypeOf ctl Is CommandButton) Then
ctl.Top = ctl.Top + oldPos - VScroll1.Value -----------------------------------> Here's where it errors out. Looks like .Top can't be use with line or something.
oldPos = VScroll1.Value
Private Sub VScroll1_Change()
Private Sub VScroll1_Scroll()