button to show/hide delete buttons

  • Thread starter Thread starter deb
  • Start date Start date
D

deb

I have a form with 3 sub forms nested
f0Site, f1Customer, f2PlantSub, f3UnitSub
F0Site holds f1Customer
f1Customer holds f2PlantSub
f2PlantSub holds f3UnitSub

Each form has a delete button. btnDelSite, btnDelCust, btnDelPlant and
btnDelUnti
I need a button on f0Site form that will show/hide the delete buttons within
each form.

A button to show and hide the delete buttons... eeek
 
This code will toggle the visibility of the command buttons
(SubformControlHoldingf1Customer, SubformControlHoldingf2PlantSub, and
SubformControlHoldingf3UnitSub are generic names for the actual names of the
subform controls on f0Site form -- a subform control is the object that
actually "holds" the subform):

Private Sub f0SiteButton_Click()
Me.SubformControlHoldingf1Customer.Form.f1CustomerButton.Visible = _
Not Me.SubformControlHoldingf1Customer.Form.f1CustomerButton.Visible
Me.SubformControlHoldingf2PlantSub.Form.f2PlantSubButton.Visible = _
Not Me.SubformControlHoldingf2PlantSub.Form.f2PlantSubButton.Visible
Me.SubformControlHoldingf3UnitSub.Form.f3UnitSubButton.Visible = _
Not Me.SubformControlHoldingf3UnitSub.Form.f3UnitSubButton.Visible
 
Back
Top