Private Sub Form_Load()
Dim spnBtnV As MSForms.SpinButton
Dim spnBtnH As MSForms.SpinButton
Set spnBtnV = Me.spnBtnVertical.Object
Set spnBtnH = Me.spnBtnHorizontal.Object
spnBtnV.SmallChange = 200
spnBtnH.SmallChange = 200
spnBtnV.Max = 10000
spnBtnH.Max = 10000
subFrmWidth = Me.Orders_Subform.Width
subfrmHeight = Me.Orders_Subform.Height
spnBtnV.Min = -10000
spnBtnH.Min = -1 * subFrmWidth
End Sub
Private Sub spnBtnHorizontal_Change()
Me.Orders_Subform.Width = subFrmWidth + (Me.spnBtnHorizontal)
End Sub
Private Sub spnBtnVertical_Change()
'Down arrow is decreasing value and makes the subform move downwards
If subfrmHeight > Me.spnBtnVertical Then
Me.Orders_Subform.Height = subfrmHeight + -1 * (Me.spnBtnVertical)
Else
Me.Orders_Subform.Height = 0
End If
End Sub