it's just a matter of how the main form is closed. i only allow my users to
close a form from a command button, which always includes the code
DoCmd.Close , , acSaveNo
subform column widths are not saved in this instance. changing the code to
DoCmd.Close
allows the default acSaveYes to apply, and subform column widths *are* saved
in this instance.
deekay, you can add a command button to your main form, and change the
form's ControlBox and CloseButton properties to No, so the user is forced to
close the form using the command button. then add an unbound checkbox to the
form so the user can checkmark the box when s/he wants to save his/her
current changes to the subform datasheet. add the following code to the
command button's Click event procedure, as
If Me!CheckboxName = True Then
DoCmd.Close
Else
DoCmd.Close , , acSaveNo
End If
replace CheckboxName with the correct name of the checkbox, of course.
recommend you precede the above code with an explicit save of the current
record, to make sure you don't lose any changes on Close, as
If Me.Dirty Then Me.Dirty = False
also, suggest you consider Tim's suggestion of a pop-up menu to restore
default settings; that's an excellent option that your users will be
grateful to have available to them.
hth
"Tim Marshall" <TI****@PurplePandaChasers.Moertheriumwrote in message
news:ei**********@coranto.ucs.mun.ca...
deekay wrote:
Thanks for the response I think this may the only way of doing it.
However what I would really like is something very simple like just
closing the form and not saving any changes rather than having to store
values, but I think I will have to do it your way.
My own experience in A97 and A2003 is that a datasheet, when a subform
of a main form, always retains its user settings. I always include a
pop up menu item to allow a user to have default widths, heights, plus
any frozen columns, restored.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me