[AccessD] [AccessD]A97 - Get Focus Main Form

Terri Jarus jarus at amerinet-gpo.com
Tue Mar 18 11:00:01 CST 2003


It was a multiple-record subform, however, the OnLostFocus event from
the field works fine (Forms![CashReceipts]![nameCbo].SetFocus
).

>>> wdhindman at bellsouth.net 03/18/03 09:41AM >>>

Terri

...if its a single record subform, try something like this. 

...on your SubCashCtl subform, set the Comments control's OnExit
property to an event, then place this in its CBF: 
      Private Sub Comments_Exit(Cancel As Integer)

          Forms![CashReceipts]![nameCbo].SetFocus
          Exit Sub
      End Sub
...if its a multiple record subform, you'd need to do a MoveLast first
and enclose the SetFocus in an IfThen construct.
...HTH :)
William Hindman
"The tree of liberty only grows when watered by the blood of tyrants.
"Bertrand Barère de Vieuzac--a Frenchman

----- Original Message ----- 
From: Terri Jarus 
To: accessd at databaseadvisors.com 
Sent: Tuesday, March 18, 2003 10:16 AM
Subject: [AccessD] [AccessD]A97 - Get Focus Main Form


I am working in a subform and want to tab from one field back to a field
on the main form.  How do I get focus to the field on the main form?

MainForm - CashReceipts
SubFormControl - SubCashCtl

Field on subform is Comments - once I tab off that field I want the
focus to set to the field  nameCbo on the main form.

I can't seem to get it right - couldn't find anything in the archives.

Thanks for any help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030318/6adafa14/attachment-0001.html>


More information about the AccessD mailing list