MS Access VBA question

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

geek_karmar, Jul 12, 4:41 pm

http://msdn. microsoft.com/en-us/library/aa211410%28office. 11
%29. aspx

geek_lifesteala, Jul 12, 5:07 pm

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... .

geek_karmar, Jul 12, 5:20 pm

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

geek_lifesteala, Jul 12, 5:52 pm