How to make subform not visible

chappy68

Registered User.
Local time
Today, 11:02
Joined
Aug 15, 2011
Messages
76
I have a form (frmMyTasks). I have two subforms on the form (tvMyTasks and sfrmMyTasks). These are always visible and there are no problems. I have a third subform (QSubform) which is made visible by a button on the form (frmMyTasks). No problems there. I have a button on the subform (QSubform) which I would like to make the form (QSubform) not visible again.

QSubform is the name of the control on my main form (frmMyTasks) which houses the form subFrmQuestions.

Code behind the button on my subform: I have tried me.qsubform.visible=false with no luck. I have tried forms!subFrmQuestions!QSubform.visible=false with no luck

Can someone please help me.
 
Firstly, I think you will need to set the focus out of that subform. I don't believe it lets you hide the form you currently have active. You should be able to do that with something like "Forms!frmMyTasks!ControlName.SetFocus" (replace bolded part with the name of the control on the main form which you want to have focus).

After that you should be able to hide it with something like "Forms!frmMyTasks!NameOfSubformControl.visible = false". Note that the bolded part should be replaced with the name of the subform object, not the form which it holds.
 
Firstly, I think you will need to set the focus out of that subform. I don't believe it lets you hide the form you currently have active. You should be able to do that with something like "Forms!frmMyTasks!ControlName.SetFocus" (replace bolded part with the name of the control on the main form which you want to have focus).

After that you should be able to hide it with something like "Forms!frmMyTasks!NameOfSubformControl.visible = false". Note that the bolded part should be replaced with the name of the subform object, not the form which it holds.

Not sure why I like to overcomplicate everything. After a small nap, I took a look and decided that since I could make the subform visible on the main form with a button, I could also make the same subform not visible with another button. It worked. It actually flows better since I put an option group frame around the two buttons. Thanks for the reply CBrighton.
 

Users who are viewing this thread

Back
Top Bottom