Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: How set focus to sub form?

0 views
Skip to first unread message

mscertified

unread,
Sep 13, 2005, 5:33:45 PM9/13/05
to
To do that I have to sign on to Microsoft Passport and that is a severe
disincentive.

"Ofer" wrote:

> One more thing, you should rate the response you are getting, to let others
> in the Community know whether they should bother reading a post or not by
> rating posts. If you find the information in a post useful, chances are that
> other people will too.
>
> If you check the last pages in the discussion group youll find out, that
> only the post that were rated as answer left, so others can refer to them.
>
> So it is important to rate an answer, as an answer or not.
> Sorry to bother you with this
>
>
>
> --
> I hope that helped
> Good luck
>
>
> "mscertified" wrote:
>
> > I have a form and a subform with a one-many relationship. Before I exit the
> > form, I must validate that there is at least one row in the subform.
> > Is there an easy way to do this?
> > Also, if there is no row, I display a msgbox and then need to set focus to
> > the subform, how? I tried the syntax in my Access book and it does not work.
> > Here is what I used:
> >
> > Me.Controls("frmCorrespRuleXref_subform").Form.Controls("Chapter").SetFocus

Ofer

unread,
Sep 13, 2005, 5:40:25 PM9/13/05
to
I just assumed that you did, seeing the question mark next to the question.
My mistake sorry, I'll keep in mind.

Ofer

unread,
Sep 13, 2005, 5:43:22 PM9/13/05
to

Ofer

unread,
Sep 13, 2005, 5:46:44 PM9/13/05
to
On the unload event of the form write the code
' To check if any records were entered
If Me.SubFormName.Form.RecordsetClone.RecordCount = 0 then
cancel=true ' Wont let exit the form
me.SubFormName.Form.FieldName.SetFocus ' Set the focus to the field
exit sub
End if
0 new messages