View Single Post
  #3  
Old August 28th, 2008, 03:03 PM posted to microsoft.public.access.forms
dsc2bjn
external usenet poster
 
Posts: 94
Default do not save data on subForm

If I do as you suggest, the user wouldn't be able to enter any new
(subform)records or update any (subform) records.

My gut is telling me to allow the data to be written to the (subform) data
table, and add a query command that on dirty for the main form would delete
the children records.

I was hoping for a simple solution.

"Jeanette Cunningham" wrote:

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