From: gmazza via AccessMonster.com on
Hey there,
When a user enters data on my form, and then either switches to another open
tab, OR clicks on a button on the current form that opens another form, I
want their data to be saved.
How can I go about this?
I tried the OnDirty event of the form as well as the Lost Focus event and
neither is firing so I am at a loss.
Any help is appreciated!
Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/201003/1

From: John Spencer on
In the button's click event, add
If Me.Dirty = True then Me.Dirty = False.

On the tab control's change event insert the same line of code

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

gmazza via AccessMonster.com wrote:
> Hey there,
> When a user enters data on my form, and then either switches to another open
> tab, OR clicks on a button on the current form that opens another form, I
> want their data to be saved.
> How can I go about this?
> I tried the OnDirty event of the form as well as the Lost Focus event and
> neither is firing so I am at a loss.
> Any help is appreciated!
> Thanks!
>
From: Tom van Stiphout on
On Wed, 17 Mar 2010 20:50:14 GMT, "gmazza via AccessMonster.com"
<u37142(a)uwe> wrote:

It depends on your exact situation. Try the Deactivate event.
Of course if there is a button click event to open another form, you
can save there:
if me.dirty then
docmd.Save acForm, me.name
endif

-Tom.
Microsoft Access MVP


>Hey there,
>When a user enters data on my form, and then either switches to another open
>tab, OR clicks on a button on the current form that opens another form, I
>want their data to be saved.
>How can I go about this?
>I tried the OnDirty event of the form as well as the Lost Focus event and
>neither is firing so I am at a loss.
>Any help is appreciated!
>Thanks!
From: gmazza via AccessMonster.com on
The button's click event worked perfect John, thanks!
Not sure what you mean by the tab control's change event. Do you mean the
current form's On Change Event?
Thanks!


John Spencer wrote:
>In the button's click event, add
> If Me.Dirty = True then Me.Dirty = False.
>
>On the tab control's change event insert the same line of code
>
>John Spencer
>Access MVP 2002-2005, 2007-2010
>The Hilltop Institute
>University of Maryland Baltimore County
>
>> Hey there,
>> When a user enters data on my form, and then either switches to another open
>[quoted text clipped - 5 lines]
>> Any help is appreciated!
>> Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/201003/1

From: Rick Brandt on
gmazza via AccessMonster.com wrote:

> The button's click event worked perfect John, thanks!
> Not sure what you mean by the tab control's change event. Do you mean the
> current form's On Change Event?
> Thanks!

You're subject includes "...when switching tabs...". The Change event of
the TabControl is the event that fires when you switch tabs.