button to show/hide delete buttons

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
 
K

Ken Snell \(MVP\)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top