MS Access VBA question

karmar, Jul 12, 4:41am
Hi there, I have a textbox on a form that I need to ensure has a value before the user continues. I have tried Validation Rules, I have tried writing vba on the AfterUpdate event, but each time it allows me to tab through the textbox without adding a value. Can somebody please help.
Many thanks

lifesteala, Jul 12, 5:07am
http://msdn. microsoft.com/en-us/library/aa211410%28office. 11
%29. aspx


karmar, Jul 12, 5:20am
Thanks for that, spotted that. So once the error message has triggered how do get the focus back to the textbox that needs filling in. I have tried...
If IsNull(Me. TaskName) Then
Msgbox "This is... "
End If
Me. TaskName. SetFocus
This just then goes to the next textbox. I want it to go back to the TaskName textbox.
Please help. I am going crazy... .

lifesteala, Jul 12, 5:52am
Can you store the previous control in a variable? So when it gets to next control... it checks previous control for null input. . if yes, focus it to previous control (that you stored). .

Been a while so not to sure

Share this thread

Buy me a coffee :)Buy me a coffee :)