Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Tab Control Movement Question

Status
Not open for further replies.

cpsqlrwn

IS-IT--Management
Jul 13, 2006
106
US
I have a subform linked to a main form. I will call this the primary subform. In the primary subform is a tab control with an additional subform on each each tab control page. I am trying to prevent a user from saving changes to an existing primary subform record by clicking down into one of the tabbed page subforms. Is there an exit event for the primary subform where I might be able to write some code to capture the movement away from the primary subform into the tabbed control and redirect it back to the primary subform? I am trying to control record changes by routing all edits through a validation script linked to a command box. Thanks for any help!
 
How about setting the Locked Property to Yes for the subforms?
 
Remou:

That makes sense and also brings up a few other possibilites. However, I don't see a locked or enabled property in the form property sheet. Is there a form locked property setting that I can enable and disable? Or should I just be locking and disabling all controls on the subform and unlocking them after the primary subform record is saved?
 
Look at the subform control, not the form contained. You can select it from the dropdown list on the toolbar, or click on the very edge of the subform.
 
Got it! Can I then unlock this form and relock it at the appropriate time through VBA code similar to unlocking and locking a control?
 
I mean lock and unlock the control, not the form!
 
What would be the syntax for the subform control?
 
It is the same as any control:

[tt]Me.[Control name].Enabled=True[/tt]
 
Why not having all your validation rules enforced in the BeforeUpdate event procedure of the primary subform ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top