records being overwritten/changed when switching to design view and then back

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a FORM which contains a COMBO BOX with a list of numbers (100, 200, and 300

It defaults to the first number (100)... if you select say 200, and then decide you need to change something in the form so you switch to FORM DESIGN .. then switch back to FORM VIEW... the record in the TABLE that was referenced by the combo box that had the value 100 now has the value 200. Is there a way to prevent this? I hope that was clear.
 
munscher said:
I have a FORM which contains a COMBO BOX with a list of numbers (100,
200, and 300)

It defaults to the first number (100)... if you select say 200, and
then decide you need to change something in the form so you switch to
FORM DESIGN .. then switch back to FORM VIEW... the record in the
TABLE that was referenced by the combo box that had the value 100 now
has the value 200. Is there a way to prevent this? I hope that was
clear.

Changing from Form View to Design View is tantamount to closing the
form, and Access will always try to save the current record when you
close the form, if it's "dirty" (i.e., modified and unsaved). What
would you want Access to do instead? Access doesn't know if you're ever
going to switch back to Form View, and it assumes that you've changed
data and want those changes saved.

You could press the Escape key to undo your changes before you switch to
Design View.
 
thanks for the info, at least i understand it better

so is there no way at all to safeguard this? lock the entries from edit in the table maybe?
 
munscher said:
thanks for the info, at least i understand it better.

so is there no way at all to safeguard this? lock the entries from
edit in the table maybe?

If the form is opened to allow edits, and the combo box is bound to a
field in the table, then the user's changes to the combo box are going
to be reflected in the table unless the update is canceled in some
fashion.

You can (a) set the form's AllowEdits property to No/False
permanently -- in which case there's not really much point in using a
combo box to display the field from the table -- or (b) set the combo
box's Locked property to Yes/True, or (c) do either of the above, but
have a button on the form that "unlocks" the form or the control to
allow edits, or (d) do something else depending on how you want the form
to be used (which I don't know).

What you do really depends on how you intend the form to be used. What
is this combo box for if you don't want the user to be able to change
its value?
 
Back
Top