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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Focus from Subform to the Form

Status
Not open for further replies.

carfj1

Technical User
Jan 19, 2003
58
MX
The configuration is:

Main Form
3 Unbound TextBoxes

Subform
5 Independent fields + 3 fields with data from the 3 Unbound Boxes

The master and child fields are the Unbound boxes.

The problem:
I want to make sure the subfrom can not get focus unless the tree ubound boxes have data.

I am using a Macro condition to test IsNull values on the unbounds text boxes. It works on the Main form because I can catch through the tabOrder if there is a missing data.

But on the most lilely event that a user uses the moust to get to the subfrom this won't work.

What I really need is an instruction to send the focus from the subform to the form if a data is missing on the main form.

Any ideas will be appreciated,
 
Have you tried to use the OnCurrent event of the subform to check the values? I believe you can check there and kick the focus back to the main form if any of your unbound fields have a null value.
 
Nop, I am reciving, the following message:
_______________________________________________________
Miscrosoft Access can't move the focus to the control FechaProg.

* The control maybe a label
* The visible property may be set to NO.
* The Enabled Propoerty may be set to NO.
_________________________________________________________

I just can't get the focus to the main form.

Thanks
 
Can you tell me what FechaProg is? Is it a control on the main form or is it the subform? When does it give you the error message?

I would still try to check the unbound boxes for values in code called by the OnCurrent event. If any of the three boxes is null, set cancel to True. My guess, I'm sorry it has to be a guess, is that the subform won't gain focus leaving you on the main form. Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top