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!

Question About Making Form Dirty 2

Status
Not open for further replies.

Accel45

Technical User
Jul 7, 2004
83
US
I have two forms: Form1 and Form2.

Form1 contains demographic information.
Form2 opens from Form1 via a command button.
Form2 contains data that can be sent to Form1 by clicking a command button (cmdSend) on Form2.
The code under lying cmdSend is:
Forms!Form1.RFirstName = me.FirstName
Forms!Form1.RLastName = me.LastName
and so on…

On Form1 I have cmdCloseWithOutSaving which becomes visible when Form1 is Dirty.
(Event On Dirty: Me.cmdCloseWithOutSaving.Visible = True)

The purpose of cmdCloseWithOutSaving is to allow the user to undo any changes made to Form1.

The Event on Dirty works correctly if the data in Form1 is entered or edited via the keyboard.

But when I enter or edit the data on Form1 by sending the data from Form2, Form1 does not become dirty and cmdCloseWithOutSaving does not become visible.

How do I get Form1 to become dirty when sending data from Form2.

Thank you for your help.
 
Have you tried this ?
Forms!Form1.Dirty = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,Thank you for your response

Yes, I tried Forms!Form1.Dirty = True. I get this error message: "In order to change data through this form, the focus must be in a bound field that can be modified.
 
why not include Form1.cmdCloseWithOutSaving.Visible = true in the the cmdSend_Click event?

Cheers,

Roel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top