Why oh why cant i do 'If dirty'

bunji

Registered User.
Local time
Today, 19:18
Joined
Apr 26, 2005
Messages
124
Please help,

I have more than one cancel button which is made visible depending on the previous form that has opened the current form.

ie. on Form1

FORMS!frmSub!cancelbuttonfrm1.visible=true

or Form 2

FORMS!FrmSub!cancelbuttonfrm2.visible=True

I want it to run an undo before closing, undo the previous form and close back to the mainmenu. However if the form isnt dirty (No changes have been made) then when the undo is called i get a run time error.

So why not do it as on dirty cancelbuttonfrm1.visible=true i hear you ask, well how can i make different buttons visible dependant on the previous form?

Obviously Access knows that the form is dirty because it triggers the undo or do you want to save.

So can i not just do 'IF Frmsub is dirty then undo else close form'
 
bunji said:
Please help,
So can i not just do 'IF Frmsub is dirty then undo else close form'

How about something like

If [Forms]![frmSub].Form.Dirty = True Then
...
End If
 
Thank you that did the trick!
 

Users who are viewing this thread

Back
Top Bottom