Form Becomes Dirty without User Entering/Selecting Data

G

Guest

I have a form that uses command buttons to changes the look of the form; for
example, if button “A†is clicked, the form changes and only those fields
associated to button “A†are displayed; if button “B†is clicked, the form
changes and only those fields associated to button “B†are displayed; and so
on.

Additionally, whenever a command button is clicked, its color changes to
dark blue, while the previously selected button changes to light blue (as is
the color of the other buttons; the dark blue button helps the user identify
the type of form that is presently displayed.

The forms include combo-boxes, option buttons, text boxes, labels, and
command buttons.

Currently, the form works as follows:

1. User selects form type (A, B, C, etc).
2. User fills in the form.
3. User saves the record by pressing a Save Record command button.
4. An empty form is displayed.

If the user fills in the form then realizes the wrong form was used,
selecting a new form will cause all the data just entered to be lost; the
form will be empty; for instance, if the user fills in form type “Aâ€, then
realizes the wrong form was used and then clicks form type “Bâ€, all
previously entered data will be lost.

I would like to revise the form to perform as follows:

1. User selects form type (A, B, C, etc).
2. User fills in the form.
3. User changes form type (from “A†to “Bâ€, for instance) before saving the
record.
4. A message appears advising that changes were made and asks if the user
wishes to save the changes.

Also, the form should perform like this:

1. User selects form type (A, B, C, etc).
2. User does NOT enter data.
3. User changes form type (from “A†to “Bâ€, for instance).
4. A message does NOT appear to advise that changes were made. <<<This is
where I'm encountering problems. The message will appear whenever the form
type is changed, regardless of no data having been entered by the user.

I have used Check Dirty, but this does not work because the form will always
be dirty when selecting between form types.

Anyone have a solution for this?

Thank you,
Richard
 
K

Keith Wilby

RichW said:
I have a form that uses command buttons to changes the look of the form;
for
example, if button “A†is clicked, the form changes and only those fields
associated to button “A†are displayed; if button “B†is clicked, the form
changes and only those fields associated to button “B†are displayed; and
so
on.

Additionally, whenever a command button is clicked, its color changes to
dark blue, while the previously selected button changes to light blue (as
is
the color of the other buttons; the dark blue button helps the user
identify
the type of form that is presently displayed.

The forms include combo-boxes, option buttons, text boxes, labels, and
command buttons.

Currently, the form works as follows:

1. User selects form type (A, B, C, etc).
2. User fills in the form.
3. User saves the record by pressing a Save Record command button.
4. An empty form is displayed.

If the user fills in the form then realizes the wrong form was used,
selecting a new form will cause all the data just entered to be lost; the
form will be empty; for instance, if the user fills in form type “Aâ€, then
realizes the wrong form was used and then clicks form type “Bâ€, all
previously entered data will be lost.

I would like to revise the form to perform as follows:

1. User selects form type (A, B, C, etc).
2. User fills in the form.
3. User changes form type (from “A†to “Bâ€, for instance) before saving
the
record.
4. A message appears advising that changes were made and asks if the user
wishes to save the changes.

Also, the form should perform like this:

1. User selects form type (A, B, C, etc).
2. User does NOT enter data.
3. User changes form type (from “A†to “Bâ€, for instance).
4. A message does NOT appear to advise that changes were made. <<<This is
where I'm encountering problems. The message will appear whenever the
form
type is changed, regardless of no data having been entered by the user.

I have used Check Dirty, but this does not work because the form will
always
be dirty when selecting between form types.

Anyone have a solution for this?

Thank you,
Richard

Use the form's Before Update event for your confirmation message. Cancel =
True if they answer "No". If the form isn't dirty the event won't fire.

Keith.
www.keithwilby.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top