E
Elizabeth
My form requires that all fields are completed in order
for the user to save the record and exit. The form has 3
command buttons:
cmdSave
cmdCancel
cmdExit
I'm having a bear of a time figuring out the logic for all
of the scenarios that involve these buttons:
cmdSave should be disabled until all the form fields are
complete. What is the command to do this and where does it
go? I suspect it has something to do with Dim.?
User click cmdSave, all the fields are complete, then
clicks cmdExit, the form closes and all is right with the
world.
However, if the user clicks cmdSave, then changes a field
(s), then clicks cmdExit, a message box should come up
asking if they want to cmdSave or just cmdExit without
saving the changes. Or, perhaps they just want to forget
about adding the record (cmdCancel and/or cmdExit).
If the user clicks cmdSave, changes a field to IsNull
(which is a no-no), then clicks cmdExit, they should be
prompted to complete all the fields, forget about the
changes or cancel adding the record (cmdCancel and
cmdExit). If any of the fields IsNull after, cmdSave
should be disabled.
Then there's the situation when the user clicks cmdCancel
or cmdExit without entering any information, which would
mean they decided not to add to the table at all.
I've tried all sorts of data validation exercises on the
three command buttons, but the number of lines of code is
mind-boggling, very messy, and almost always gets cocked
up!
It all seems really rather silly since Save is a moot
point because the information is being written into the
table anyway, but I think users like the security and
familarily of seeing a Save command in programs.
Can anyone advise me how to deal with all this with some
sample code (please know that I'm a Newbie).
Many thanks,
Elizabth
for the user to save the record and exit. The form has 3
command buttons:
cmdSave
cmdCancel
cmdExit
I'm having a bear of a time figuring out the logic for all
of the scenarios that involve these buttons:
cmdSave should be disabled until all the form fields are
complete. What is the command to do this and where does it
go? I suspect it has something to do with Dim.?
User click cmdSave, all the fields are complete, then
clicks cmdExit, the form closes and all is right with the
world.
However, if the user clicks cmdSave, then changes a field
(s), then clicks cmdExit, a message box should come up
asking if they want to cmdSave or just cmdExit without
saving the changes. Or, perhaps they just want to forget
about adding the record (cmdCancel and/or cmdExit).
If the user clicks cmdSave, changes a field to IsNull
(which is a no-no), then clicks cmdExit, they should be
prompted to complete all the fields, forget about the
changes or cancel adding the record (cmdCancel and
cmdExit). If any of the fields IsNull after, cmdSave
should be disabled.
Then there's the situation when the user clicks cmdCancel
or cmdExit without entering any information, which would
mean they decided not to add to the table at all.
I've tried all sorts of data validation exercises on the
three command buttons, but the number of lines of code is
mind-boggling, very messy, and almost always gets cocked
up!
It all seems really rather silly since Save is a moot
point because the information is being written into the
table anyway, but I think users like the security and
familarily of seeing a Save command in programs.
Can anyone advise me how to deal with all this with some
sample code (please know that I'm a Newbie).
Many thanks,
Elizabth