Dirty Flag for unbound form
Posted by: fredometro on
Jan 15th, 2004 |
Filed under: MS-Access
The dirty flag doesn’t work when the form is unbound. Here the technique is to use the validation rule like an event in order to set the flag. Easy: A simple function returning the control’s text itself can do the job!
I bother for the performance so my code also checks for the existence of a former validation rule. Setting properties of many controls could make the form open slower without this check.
Once the form is first opened with this method, then saved, there is no need of re-doing the function so the form opens faster because for sure testing for the existence of SetDirty validation rule will make an exit.
Private Sub Form_Open(Cancel As Integer)
Dim ctr As Control
Dim frm As Form
Set frm = Me
For Each ctr In frm
On Error Resume Next
if ctr.validatonrule=”SetDirty()” then ‘ Already done, let’s not smash an open door!
exit sub
On Error Goto 0
if isempty(ctr.Validationrule) then
ctr.ValidationRule = “SetDirty()”
end if
Next ctr
End Sub
And, of course don’t forget the SetDirty function:
Public Function SetDirty()
IsDirty = True
SetDirty = Me.ActiveControl.Text
End Function
The full EE thread can be read here:
http://www.experts-exchange.com/Databases/MS_Access/Q_11879478.html.html


May 16th, 2009 at 10:48 pm
Have a nice day. From http://www.genstkobr.com
June 14th, 2009 at 4:48 am
The article is ver good. Write please more
June 30th, 2009 at 11:49 am
XINMhg comment5 ,
July 6th, 2009 at 9:40 pm
Hello! Thanks for the post. It is really amazing! I will definitely share it with my friends.
September 5th, 2009 at 6:20 am
Hello. My name is Chris. I’m from USA. I’m new to this forum, i was hoping you could maybe teach me some stuff.
This is me-> http://lmageshack.us/img/chrisP.jpg - Just so you know who i am! feel free to post your own photos. Allways best to know who you talk to!
December 5th, 2009 at 4:45 am
stunning post
competitive intelligence
December 12th, 2009 at 7:38 am
Amateur Appeal
December 12th, 2009 at 7:39 am
Sapphic Erotica
December 12th, 2009 at 7:40 am
My Wife Needs Cocks
December 12th, 2009 at 7:41 am
Whitney 36DD
December 12th, 2009 at 7:42 am
Tranny Cum Squirting
December 12th, 2009 at 7:43 am
Granny Fucks
December 12th, 2009 at 7:44 am
Rubber Penetrations
December 12th, 2009 at 7:45 am
MILF Pornos
December 12th, 2009 at 7:46 am
Interracial Sex House
December 12th, 2009 at 7:47 am
Cought Teen Couples
December 12th, 2009 at 7:48 am
All Teen Action
December 12th, 2009 at 7:49 am
Princess 8teen
December 12th, 2009 at 7:51 am
Apple iPod Touch 2nd and 3rd Generation
December 12th, 2009 at 7:52 am
Jizz Whore Party
December 12th, 2009 at 7:53 am
Gay Snowballs
December 12th, 2009 at 7:54 am
Little Danni
December 16th, 2009 at 10:28 am
“Thank you for the suggestion, sir,” The Bishop answered sweetly. “But I think I
—————– gse55565se6g6dfg21 ——————
order propecia 5mg without prescription
December 17th, 2009 at 1:25 am
was like a chess game that you played in your head. I could see the opening moves
———————————–
generic viagra professional 100mg
December 20th, 2009 at 2:53 pm
Harrison - SSR 6 - A Stainless Steel Rat Is BornUC buy allegra “What bright side?”
January 14th, 2010 at 10:02 am
for the accusing words. Waited . . . let my eyes travel up the blue-clad legs . . . pharmacy schools
Add A Comment
You must be logged in to post a comment.