Button to open form

L

Luis

Hello.
I have a form with two buttons and an unbound subform.
What i'd like to do is, depending on the button i click,
the subform displays the corresponding form. This means
that the Source object of the subform changes depending of
the button clicked.

How can i do this ?

Thanks
 
R

Rick Brandt

Luis said:
Hello.
I have a form with two buttons and an unbound subform.
What i'd like to do is, depending on the button i click,
the subform displays the corresponding form. This means
that the Source object of the subform changes depending of
the button clicked.

How can i do this ?

I would use Toggle Buttons instead within an OptionGroup. Then you can
just use the Change event of the Group.

Select Case Me.OptionGroupName
Case 1
Me.SubFormControlName.SourceObject = "SomeForm"
Case 2
Me.SubFormControlName.SourceObject = "SomeOtherForm"
End Select

You "could" stay with Command Buttons but then you would need to create two
separate event procedures instead of just the one.
 
L

Luis

Ok. Thank you very much. I'll give it a try.

-----Original Message-----


I would use Toggle Buttons instead within an OptionGroup. Then you can
just use the Change event of the Group.

Select Case Me.OptionGroupName
Case 1
Me.SubFormControlName.SourceObject = "SomeForm"
Case 2
Me.SubFormControlName.SourceObject = "SomeOtherForm"
End Select

You "could" stay with Command Buttons but then you would need to create two
separate event procedures instead of just the one.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


.
 
S

Sam Hobbs

Isn't a tab control a useful alternative? Perhaps people should be
suggesting the tab control more often.

Of course, I have not used a tab control in Access Basic, but I have in VB
and VC. I assume they are as easy in Access Basic as in VB. If not, then I
apologize for not knowing.
 

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