Pyro
Too busy to comment
- Local time
- Tomorrow, 07:55
- Joined
- Apr 2, 2009
- Messages
- 127
Hey,
So i have come across a problem that i have found in some error trapping that i am doing this afternoon. When trying to enter data into a subform before the parent record is generated, Access throws you an error - no biggie, stock standard basic stuff. Replacing that error with something more coherent to my readers is easy, again no problem. The problem lies in that the value that was selected from that combo box or entered into that field is now still sitting in that control staring at me. If i try to select elsewhere i get that same error thrown back at me. I know i can hit the Escape key and undo it, i can even tell my users to do that. What i would like to know is has anyone come up with a way to undo that entry, or simulate the Escape key scenario.
Undo does not work because it seems that the error is trapped before the control is updated. I tried to skip around that by first moving the focus somewhere else and then running the undo command, but that seemed to lock every combo box in the entire db, or as i like to think of it, break Access.
I have managed to achieve this in small subforms by forcing a save on the one or two controls within it and trapping the error in the afterupdate event, but there is no way that i am going to try this on a larger form with many more controls...
To me it just seems more intuitive to drop an error that says "Sorry, you can't update X until you update Y. Please update Y and then try again", and then undo the entry. As opposed to saying "Sorry, you can't update X until you update Y. Please click OK, then press Escape then update Y and then try again."
Any help will be much appreciated.
So i have come across a problem that i have found in some error trapping that i am doing this afternoon. When trying to enter data into a subform before the parent record is generated, Access throws you an error - no biggie, stock standard basic stuff. Replacing that error with something more coherent to my readers is easy, again no problem. The problem lies in that the value that was selected from that combo box or entered into that field is now still sitting in that control staring at me. If i try to select elsewhere i get that same error thrown back at me. I know i can hit the Escape key and undo it, i can even tell my users to do that. What i would like to know is has anyone come up with a way to undo that entry, or simulate the Escape key scenario.
Undo does not work because it seems that the error is trapped before the control is updated. I tried to skip around that by first moving the focus somewhere else and then running the undo command, but that seemed to lock every combo box in the entire db, or as i like to think of it, break Access.
I have managed to achieve this in small subforms by forcing a save on the one or two controls within it and trapping the error in the afterupdate event, but there is no way that i am going to try this on a larger form with many more controls...
To me it just seems more intuitive to drop an error that says "Sorry, you can't update X until you update Y. Please update Y and then try again", and then undo the entry. As opposed to saying "Sorry, you can't update X until you update Y. Please click OK, then press Escape then update Y and then try again."
Any help will be much appreciated.
Last edited: