Open Subform OnClick????

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to create a subform that you can open with an OnClick Event
which, would enable the ability to have numerous subforms attched to a form???

If so, can you help me resolve the issue?

Thank you.
 
Do you mean have say 3 different subforms, but not visible until you click a
button to show them? If so:
Form's on_open event set all 3 subforms to hidden:

me.subform1.visible = false
me.subform2.visible = false
me.subform3.visible = false

for each button, set one to true:
Button 1 on_click event:
me.subform1.visible = true
me.subform1.visible = false
me.subform1.visible = false

Button 2 on_click event:
me.subform1.visible = false
me.subform2.visible = true
me.subform3.visible = false

Button 3 on_click event:
me.subform1.visible = false
me.subform2.visible = false
me.subform3.visible = true

However, I think it might be more intuitive for your users to use a tab
control - and less work for you!
 
Yes, I have one form that has 5 sub forms the user can switch to. Here is
the code:

'Select the subform
Me.fsubTableEdit.SourceObject = "fsubEmployee"
'Had to do the maximize because the above line causes the main form to resize
DoCmd.Maximize
'Sets the width of the subform object, all 5 use same height, but different
widths
Me.fsubTableEdit.Width = 6000
 
Back
Top