View Single Post
  #2  
Old August 27th, 2008, 10:48 PM posted to microsoft.public.access.forms
Jeanette Cunningham
external usenet poster
 
Posts: 2,190
Default do not save data on subForm

hi dsc2bjn,
it's more tricky with a subform.
The way access works is to save any data in the subform as soon as the user
clicks out of the subform onto the main form or any control on the main
form.
You could set the subform's data property to set allow edits, allow
deletions, allow additions and data entry to No. This would prevent the user
making any changes to the data in the subform.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



"dsc2bjn" wrote in message
...
I have form which contains a subform. I placed code in the main form to
not
save the information, if the user clicks on a "Close without Saving"
button.
If the subform contains data, the record is saved anyway. How can I drop
the subform data if the user click on the "Close without Saving" button?

Code in my main form:

If Me.Dirty Then

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close