Control must be filled in first

Fozi

Registered User.
Local time
Today, 09:29
Joined
Feb 28, 2006
Messages
137
Hi all

On a form I have a control called [Week Commencing]. Within this form are two subforms joined by this control.

On entering a new record focus is set to [Week Commencing]. I want the form to prevent users moving away from this control if it has no entry.

Any clues?

Thanks for taking time.
Fozi
 
There are numerous posts on this form dealing with the same problem you are describing.

One option would be to check the entry on the before update event

if isnull(yourfieldname) or yourfieldname="" then
msgbox "you dont have anything in the field."
cancel=true
yourfieldname.setfocus
else
end if
 
Thanks for the reply rainman. i tried searching and found some info on ensuring controls have an entry but little on those where there must be an entry and where it must be filled in first before moving onto the other controls on the form.

Tried the code you suggested. It triggers if something is typed into the control and then deleted. When the user moves onto the other fields it blocks with the message. However on first entering the form it still lets the user move on providing they haven't typed into the control in the first instance.

Cheers
Fozi
 
Hi.

Got it sorted by placing the code in the On Enter Property of the Two subforms.

Thanks for your help.
Fozi
 

Users who are viewing this thread

Back
Top Bottom