Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unbound form and Dirty property 2

Status
Not open for further replies.

Glohamar

Programmer
Sep 3, 2003
248
US
I am wanting to know when the data on the form has changed. I get Run-time error '2455', Invaild reference to the Dirty Property.

I have use this before Dirty property with no problems, but that was on Bound forms, so I am wondering if it is different for UnBound forms and what do I need to change for this to work. This is what I have so far...

Private Sub lblClose_Click()
If Me.Dirty Then
' Prompt to confirm the save operation.
If MsgBox("Do you want to save?", vbYesNo + vbQuestion, _
"Save Record") = vbNo Then
'Do not save changes and return to main menu
Me.Undo
DoCmd.Quit
Else
Call Save_Click
End If
End If
End Sub

TIA

Dave
 
Since 'Dirty' refers to the fact of a difference between the versions of the controls' value from the starting value to the current value and there is no 'starting value' for unbound controls ...


You would need to create your own version / workaround. Some variations of this do exist, although I do not rember the w5 thereof. I seemto recall one version which used the tag property and filled it with a CSV setof values actuated by the other properties (lost focus?) to check the current value aginst the last value in the CSV list ... but then I often incur "memory faults" ...




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Yeah, as Michael says, you'll have to write your own code to do this. It's not complex, but you will have to use it in a lot of places. One thing that can help you here is to write small functions that can be called directly in the property sheet of a control. That way you can select all relevant controls on the form, pull up the property sheet, and enter the name of the function(s) in the appropriate boxes.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Thanks for the help guys. Had no idea it would be that inconvenient. Well, guess I'd better get busy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top