1,105,344 Community Members

Disable MDI parent form button from MDI child form

Member Avatar
manutd4life
Junior Poster
123 posts since Dec 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Ok i have a button on MDI parent form and i need to disable it when closing a child form. When writing the button name (cmdmenu) in the child form, it says that the cmdmenu is not declared please help

Member Avatar
Pgmer
Practically a Posting Shark
881 posts since Apr 2008
Reputation Points: 50 [?]
Q&As Helped to Solve: 158 [?]
Skill Endorsements: 3 [?]
Featured
 
0
 

That button should be publicaly decalred.
if it is publically availabele then
in child form closing event

Mdiform.cmdmenu.disabled=true
Member Avatar
manutd4life
Junior Poster
123 posts since Dec 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

how to declare a button in module

Member Avatar
manutd4life
Junior Poster
123 posts since Dec 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Got it i solved it
Here's the code

Dim par As frmMainmenu = Me.MdiParent
        par.cmdmenu.Enabled = False

no need to declare it in module, it works great

Question Answered as of 4 Years Ago by Pgmer
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article