Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Differenc between Lost Focus and On Exit

Geek News

Differenc between Lost Focus and On Exit
Jacqueline 12/12/2008 9:14:00 PM
Can someone explain the difference between these two events for me please? I
want to creat an event to move the cursor to the first input box on the form
when the user clicks the New Record button.

Thank you,
--
Jacqueline
RE: Differenc between Lost Focus and On Exit
Beetle 12/12/2008 9:33:01 PM
Use the forms Current event instead.

Private Sub Form_Current

If Me.NewRecord Then Me![SomeControl].SetFocus

End Sub
--
_________

Sean Bailey


"Jacqueline" wrote:

[Quoted Text]
> Can someone explain the difference between these two events for me please? I
> want to creat an event to move the cursor to the first input box on the form
> when the user clicks the New Record button.
>
> Thank you,
> --
> Jacqueline
RE: Differenc between Lost Focus and On Exit
Jacqueline 12/12/2008 10:07:01 PM
Sean,
I am not the strongest VB user but have ventured into some simple stuff.
However, now that I am in Access 2007 when ever I open the code option box
all I see is the start and stop of the sub routine, no code between.

I have been afraid to mess around with it for fear of messing something up.
I have also made sure my databases are in a "Trusted Folder". Have you run
into this or am I just not hold my mouth right??
Thanks much,
--
Jacqueline


"Beetle" wrote:

[Quoted Text]
> Use the forms Current event instead.
>
> Private Sub Form_Current
>
> If Me.NewRecord Then Me![SomeControl].SetFocus
>
> End Sub
> --
> _________
>
> Sean Bailey
>
>
> "Jacqueline" wrote:
>
> > Can someone explain the difference between these two events for me please? I
> > want to creat an event to move the cursor to the first input box on the form
> > when the user clicks the New Record button.
> >
> > Thank you,
> > --
> > Jacqueline
RE: Differenc between Lost Focus and On Exit
Beetle 12/12/2008 10:34:02 PM
[Quoted Text]
> when ever I open the code option box all I see is the start and stop of
> the sub routine, no code between.

That's all you should see unless you have previously put some code in that
event. In other words, if you open the properties sheet for your form, go
to the Event tab, click the build (...) button to the right of the On Current
event and select Code Builder, the code window should open displaying
the following lines;

Private Sub Form_Current ( )

End Sub

All you would need to do is put;

If Me.NewRecord Then Me![SomeControl].SetFocus

in between those lines, using your actual control name in place of
[SomeControl]. If your db is in a trusted location, then the code should
work. If you're worried about making a mistake, just make a backup
copy of your db before you make any changes (which you should always
do anyway).
--
_________

Sean Bailey


"Jacqueline" wrote:

> Sean,
> I am not the strongest VB user but have ventured into some simple stuff.
> However, now that I am in Access 2007 when ever I open the code option box
> all I see is the start and stop of the sub routine, no code between.
>
> I have been afraid to mess around with it for fear of messing something up.
> I have also made sure my databases are in a "Trusted Folder". Have you run
> into this or am I just not hold my mouth right??
> Thanks much,
> --
> Jacqueline
>
>
> "Beetle" wrote:
>
> > Use the forms Current event instead.
> >
> > Private Sub Form_Current
> >
> > If Me.NewRecord Then Me![SomeControl].SetFocus
> >
> > End Sub
> > --
> > _________
> >
> > Sean Bailey
> >
> >
> > "Jacqueline" wrote:
> >
> > > Can someone explain the difference between these two events for me please? I
> > > want to creat an event to move the cursor to the first input box on the form
> > > when the user clicks the New Record button.
> > >
> > > Thank you,
> > > --
> > > Jacqueline
Re: Differenc between Lost Focus and On Exit
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 12/13/2008 8:23:59 PM
Jacqueline wrote:
[Quoted Text]
> Can someone explain the difference between these two events for me
> please? I want to creat an event to move the cursor to the first
> input box on the form when the user clicks the New Record button.
>
> Thank you,
See the note on this page.
http://msdn.microsoft.com/en-us/library/bb238441.aspx


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net