Hi there,
I am designing a form in access.
And I want to give a message to user to Enter value if the user leave some required text box blank. Due to some reason I could not set the required property to yes. So In the lost focus event of the box I want to write code that will check for the value in the text box and there is not anything in the form it will give a message and set the focus back to that text box
So I am writing here as:
if txthours.value is null then
msgbox"Please enter the no. of hours"
txthours.setfocus
endif
but I am getting the error msg saying object is required
Can anybody help?
I am designing a form in access.
And I want to give a message to user to Enter value if the user leave some required text box blank. Due to some reason I could not set the required property to yes. So In the lost focus event of the box I want to write code that will check for the value in the text box and there is not anything in the form it will give a message and set the focus back to that text box
So I am writing here as:
if txthours.value is null then
msgbox"Please enter the no. of hours"
txthours.setfocus
endif
but I am getting the error msg saying object is required
Can anybody help?