Good Day,
I found (on the web) this very neat access DB with a collapse and expand subforms feature and i would like to use this feature on my DB. When I open the form the subforms are already expanded and by clicking a command button it will collapse. What I want to achieve is the other way around. I tried playing on the codes but no luck.
Any help are greatly appreciated.
I found (on the web) this very neat access DB with a collapse and expand subforms feature and i would like to use this feature on my DB. When I open the form the subforms are already expanded and by clicking a command button it will collapse. What I want to achieve is the other way around. I tried playing on the codes but no luck.
Any help are greatly appreciated.
Code:
Private Sub cmdMineralShutter_Click()
Dim spaceBetween As Integer, origTop As Integer
If cmdMineralShutter.Caption = "-" Then
cmdMineralShutter.SetFocus
frmSubMineral.Visible = False
spaceBetween = lblSamples.Top - frmSubMineral.Top - frmSubMineral.Height
origTop = lblSamples.Top
lblSamples.Top = lblMinerals.Top + lblMinerals.Height + spaceBetween
cmdSamplesShutter.Top = cmdSamplesShutter.Top - (origTop - lblSamples.Top)
boxSamples.Top = boxSamples.Top - (origTop - lblSamples.Top)
frmSubSamples.Top = lblSamples.Top + lblSamples.Height
cmdMineralShutter.Caption = "+"
Else
spaceBetween = lblSamples.Top - lblMinerals.Top - lblMinerals.Height
origTop = lblSamples.Top
lblSamples.Top = frmSubMineral.Top + frmSubMineral.Height + spaceBetween
cmdSamplesShutter.Top = cmdSamplesShutter.Top + (lblSamples.Top - origTop)
boxSamples.Top = boxSamples.Top + (lblSamples.Top - origTop)
frmSubSamples.Top = lblSamples.Top + lblSamples.Height
frmSubMineral.Visible = True
cmdMineralShutter.SetFocus
cmdMineralShutter.Caption = "-"
End If
End Sub
Private Sub cmdSamplesShutter_Click()
If cmdSamplesShutter.Caption = "-" Then
cmdSamplesShutter.SetFocus
frmSubSamples.Visible = False
cmdSamplesShutter.Caption = "+"
Else
frmSubSamples.Visible = True
cmdSamplesShutter.SetFocus
cmdSamplesShutter.Caption = "-"
End If
End Sub