Ozarka
Oct 27 2006, 12:02 PM
DoCmd.OpenForm stDocName, acNormal, , acFormAdd, , acDialog
I am using this script to open a form. i dont want record to be saved if there was no entry performed. this add a empty record whenever end users decide to leave the newly open form without performing any data entry.
Aquadevel
Oct 27 2006, 12:08 PM
OZ,
Why aren't you just using:
DoCmd.GoToRecord , , acNewRec
to have the user go to a 'blank' record?
Aqua
MikeLyons
Oct 27 2006, 12:08 PM
You could make certain fields Required in the table design.
If that is not an option, you could enforce entry through Validation Rules in the form.
Mike
Ozarka
Oct 27 2006, 12:18 PM
aqua - ur method did not wor
i have a main form
button # 1 > open existing record (people can select a record from combo box and then view it but using another form)
button # 2 > create new record
Ozarka
Oct 27 2006, 12:49 PM
so there is no way to open a from from another form and not save as a record till user manually input some data.
freakazeud
Oct 27 2006, 02:25 PM
Hi,
Set the Data Entry property of the form to YES...this is the only thing you should need...if the form opens up and NOTHING was touched then it should be able to close without saving the record...if there was changes then you need to use code on the close button or the before update event of the form to check if everything was filled out or not and if you want to save that or not e.g.:
If Me.Dirty = True Then
'loop through controls to check if all are non empty
'decide if you want to undo changes with Me.Undo or let the user enter the rest if some are empty
End If
HTH
Good luck
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.