Subforms question

kinger88

New member
Local time
Today, 21:15
Joined
Jul 29, 2008
Messages
6
Hi,

I have a form with a subform for entering new data which is intended for the user to be able to add a course and all the learners on that course in one go.

What i would like to know is if it is posible to have the subform hidden until a button is clicked to make it visible?

I have found many examples of subforms being made visible but all of them have been based on check boxes rather than a button.

Please note i dont know VB i only use macros at the moment so this way would be preferred if possible, if not i wil try and understand the code.

Thanks in advance
 
Without knowing any details, I can only say that if you declare the hidden attribute of the subform to be True, and then in the "On Click" attribute of the button you set it False, it will appear whenever you click the button. Making it dissappear again if you need it to is another story. Perhaps the "On Update" event of the form will be a good place for that. You will need to decide.
 
In a macro use SetValue for the action line

Item [Forms]![MASTERFORM]![SPP].[Visible]

Expression Yes

If No is used for Expression then it won't be visible

In the above example MasterForm is the main from and SPP is the name of the subform.

For code

Forms!MASTERFORM!SPP.Visible = True
 
If you want to toggle it with the button:

Me.SubformControlName.Visible = Not Me.SubformControlName.Visible
 

Users who are viewing this thread

Back
Top Bottom