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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Me.Dirty

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
I use a Calendar object, along control source bound to a field in my table. This works fine, but in msdn documentation they said that on enter a new date on the Calendar Object the date in the field is not automatically updated. I used some code that they propose to use to update instantly the date in the field.

Code:
If Me.Dirty = true then
Me.Dirty = false
end if

however this is not doing the job. I also tried
Code:
Forms![form1].Refresh
 

Not entirely sure what you're trying to accomplish here but it sounds like you want to drop all changes you've made.
If so, try this...
Code:
If Me.Dirty Then Me.Undo


Randy
 
Your first code snippet is fine, matrixindicator. Where do you have it placed? Things done when a field is populated/edited are usually executed in the BeforeUpdate or AfterUpdate events. The problem is that these events only fire if the data is physically entered/changed, not when they're changed thru code, such as when a DataPicker or Calendar is used. You have to explicitly call the event.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
hello missingling

I tried to call the event. First I set a sub with the dirty code, afterwards I call the procedure
Code:
Call refreshCalendar

Am I doing something wrong, because this is not doing the job.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top