Query to choose between forms

S

Suzie

Hi All

I have two forms, Sponsor details and Study details, I would like to make a
query whereby on opening Study details the question "Existing Sponsor?" is
asked and if the answer is "yes" the Study details form opens but if the
answer is "no" the sponsor details form opens at a new record.

Can you help please?
 
M

Michel Walsh

A possible way to do it is with VBA and a Form with a Subform. The Subform
*Control* property "SourceObject" can be assigned at run time:

Me.SubFormControlName.SourceObject = "SponsorDetails"

as example, is assigning the form SponsorDetails to be the displayed
sub-form .


So, in short, you supply the logic through VBA code and specify the form to
be displayed in the subform CONTROL, accordingly.



Note that you should be careful to differenciate the subform CONTROL and its
source, since, in general, it is its source, assigned at design time, which
is 'displayed', even at design time of the main form. Indeed, you may be
editing the form used as source for the subform control, while you wish to
edit the control itself. It is a matter to know WHERE to click: if, clicking
the mouse button, keeping it down, and then moving the mouse DOES NOT move
the position of the subform relatively to the main form, you are editing the
source, not the control.





Vanderghast, Access MVP
 

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