ACTEBS
actebs at actebs.com.au
Mon Mar 24 22:34:33 CDT 2014
Hi Bill, Many thanks for this. It works beautifully! Going through all the email regarding this subject, can I say, it great to see that active robust debate still exists in this world... Sorry it has taken me a while to get back to everyone, but I have been side tracked with another project. Thanks again Vlad -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bill Benson Sent: Monday, 24 March 2014 10:05 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Unbound Form Check For Changes Re: Dirty, even if bound, a change would mean the user began to edit the form, not that they necessarily "made" a change. As for storing the control values, if all you care about is testing if ANY controls changed, I would put a tag in every control where this is a possibility and loop through all controls, test for this tag - then you won't have to worry about labels and controls with no value throwing off a runtime error. I would just store all values in a single string using a pipe separator, and check this again later. 'Warning air code!!! Option explicit Dim m_Initial_Control_Values as String Form_Load() For each ctrl in controls If ctrl.tag = "ValidateMe" then m_Initial_Control_Values = _ m_Initial_Control_Values &"|" & NZ(ctrl.value,"") &"|" End If Next '... End Sub Have a function named FormChanged Function FormChanged() as Boolean Dim strValidate as string For each ctrl in controls If ctrl.tag = "ValidateMe" then strValidate = _ strValidate &"|" & NZ(ctrl.value,"") &"|" End If Next FormChanged = (strValidate <> m_Initial_Control_Values) End function -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com