![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In a form I might have a BeforeUpdate event that does some final validation before saving a record. Ex: If IsNull(Me.LastName) then msgbox "Please enter a last Name" Me.lastname.setfocus Cancel = True Endif I might have a command button called Exit where I can save the record Me.Dirty = False and trap the error if I attempt to close the form and not exit. If I have nav buttons, it won't permit me to go to another record or a new record until I've satisfied the error condition. If I hit the X button in the upper right corner of the window to exit, it runs the BeforeUpdate event, displays the error message, and closes the form. If it is a new record, the data is not saved. The form just closes. There is no way to correct the error. Do you employ any methodology to 1) not show the msgbox? or 2) keep the form, with its data, open if in error? New or old rec? or 3) use another event to trap/find errors? |
#3
| |||
| |||
|
|
See: Losing data when you close a form at: http://allenbrowne.com/bug-01.html In any recent version of Access, you should get a message if you close the form via the big X in the top right corner. If you use the Close method (VBA) or action (macro), you will need to explicitly save first or you get not notification. Hi Allen: |
#4
| |||
| |||
|
|
Do you employ any methodology to 1) not show the msgbox? or 2) keep the form, with its data, open if in error? New or old rec? or 3) use another event to trap/find errors? |
#5
| |||
| |||
|
|
Salad <salad (AT) oilandvinegar (DOT) com> wrote in news:Ws-dnXQ_1vH0zw3RnZ2dnUVZ_gOdnZ2d (AT) earthlink (DOT) com: Do you employ any methodology to 1) not show the msgbox? or 2) keep the form, with its data, open if in error? New or old rec? or 3) use another event to trap/find errors? 4) eliminate the form's X and use my own CLOSE button (which can be disguised to look like the normal X if you want to save space). How do you do that? Get in the right hand corner of the title bar? |
#6
| |||
| |||
|
|
David W. Fenton wrote: Salad <salad (AT) oilandvinegar (DOT) com> wrote in news:Ws-dnXQ_1vH0zw3RnZ2dnUVZ_gOdnZ2d (AT) earthlink (DOT) com: Do you employ any methodology to 1) not show the msgbox? or 2) keep the form, with its data, open if in error? New or old rec? or 3) use another event to trap/find errors? 4) eliminate the form's X and use my own CLOSE button (which can be disguised to look like the normal X if you want to save space). How do you do that? Get in the right hand corner of the title bar? |
|
My kludge works but I'd hate to do that for a field packed form. |
#7
| |||
| |||
|
|
Salad <salad (AT) oilandvinegar (DOT) com> wrote in news:0JydnTgFjKyvEwzRnZ2dnUVZ_tOdnZ2d (AT) earthlink (DOT) com: David W. Fenton wrote: Salad <salad (AT) oilandvinegar (DOT) com> wrote in news:Ws-dnXQ_1vH0zw3RnZ2dnUVZ_gOdnZ2d (AT) earthlink (DOT) com: Do you employ any methodology to 1) not show the msgbox? or 2) keep the form, with its data, open if in error? New or old rec? or 3) use another event to trap/find errors? 4) eliminate the form's X and use my own CLOSE button (which can be disguised to look like the normal X if you want to save space). How do you do that? Get in the right hand corner of the title bar? No title bar. Like this: http://dfenton.com/DFA/Splash/bellevue.jpg If you want to fake the title bar, you can do something like this: http://dfenton.com/DFA/examples/assignment.gif Very cool. |
|
My kludge works but I'd hate to do that for a field packed form. Not sure what "that" is? I described what I did in a prior post; created an array, stored the |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
I do exactly the same thing as David. I remove the title bar completely, and I also remove the controls from forms and create my own. It was the only way I could guarantee control over the process. Has worked fine for years. The Frog |

#10
| |||
| |||
|
|
The Frog wrote: I do exactly the same thing as David. I remove the title bar completely, and I also remove the controls from forms and create my own. It was the only way I could guarantee control over the process. Has worked fine for years. You guys think out of the box. ![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |