Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-17-2019, 06:57 PM   #16
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 9,822
Thanks: 107
Thanked 2,660 Times in 2,434 Posts
isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all isladogs is a name known to all
Re: Best practice form events

Excellent. Good luck with the next stage of your project

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
HillTJ (08-20-2019)
Old 08-18-2019, 09:17 PM   #17
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 27,808
Thanks: 13
Thanked 1,510 Times in 1,436 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Best practice form events

Quote:
AfterUpdate of control could include code that commits record.
Not in my world. You really do not want to send email until AFTER the RECORD has actually been saved. The AfterUpdate event of the control takes place BEFORE the record is saved so there is always the possibility that the record will not actually get saved. Using the AfterUpdate event of the control is not equivalent to using the AfterUpdate event of the form. I wasn't just suggesting an alternative.
__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
Old 08-19-2019, 02:49 AM   #18
HillTJ
Newly Registered User
 
Join Date: Apr 2019
Location: Tropical North Australia
Posts: 131
Thanks: 53
Thanked 1 Time in 1 Post
HillTJ is on a distinguished road
Re: Best practice form events

So, Pat, i just put my code in the after update of the form instead?. It's simple to try. Appreciate it.

HillTJ is offline   Reply With Quote
Old 08-19-2019, 06:09 AM   #19
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 27,808
Thanks: 13
Thanked 1,510 Times in 1,436 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Best practice form events

Yes, the AfterUpdate event of the form but as I said in my first response, you will need to use an internal flag to keep track of whether or not a date was changed since you cannot determine that information AFTER the record has been saved. You can set the flag in the control's AfterUpdate event or the Form's BeforeUpdate event. The code would be the same. You compare the data in the control to the .OldValue property.

Code:
If IsNull(Me.MyDate.OldValue) Then
    If IsDate(Me.MyDate) Then
       DateChangedFlg = True
    End If
End If
__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
The Following User Says Thank You to Pat Hartman For This Useful Post:
HillTJ (08-20-2019)
Old 08-20-2019, 01:19 PM   #20
HillTJ
Newly Registered User
 
Join Date: Apr 2019
Location: Tropical North Australia
Posts: 131
Thanks: 53
Thanked 1 Time in 1 Post
HillTJ is on a distinguished road
Re: Best practice form events

Pat, got it, will give it a go & let you know. Thanks & thanks to all for explaining the logic. I'm learning!!!!

HillTJ is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Practice Form Validation Tupacmoche Forms 7 02-05-2019 10:37 AM
Form query best practice Tskutnik Forms 4 06-26-2016 12:14 PM
Best Practice for Form Design diofree Forms 2 12-01-2015 10:46 AM
Chain of events where both form and subform have OnLoad events Galaxiom Modules & VBA 3 07-06-2009 05:19 AM
Best practice form design Navyguy Forms 8 06-07-2004 11:37 AM




All times are GMT -8. The time now is 02:12 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World