set tab control pages to display conditionally

G

Guest

On an orders form (frmOrders based on an underlying query qryOrders) I have a
tab control (tabDrctOrAgnt) with two pages containing two alternative order
details subforms. I want subform A (sfrOrdDetAgnt) to display if a value in a
control (txtClientType) on the orders form is "agent" and subform B
(sfrOrdDetDirct) to display if the control value is not "agent". The
txtClientType control is set to "not visible" and its purpose is to trigger
the automatic display of the correct subform according to the ClientType
value for the client in the underlying query.

I know I need some sort of Event Procedure, probably on After Update on the
txtClientType control, but I really don't know how to go about this. My
knowledge of VBA is miniscule.
 
V

Van T. Dinh

If you set it invisible, the user cannot update it so I don't think the
txtClientType_AfterUpdate will occur.

My guess is that you need to use the Form_Current Event for existing
Records. If you are using the same Form to add new Records, then you will
also need to use another Event when the ClientType is determined, e,g, when
you select a particular Client where you can determine the ClientType.
 

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