validation rule

hkinh_nguyen

New member
Local time
Today, 09:31
Joined
Mar 7, 2007
Messages
9
Hi,

Can anyone show me how to do force a user to select from a list before proceeding further.
 
I know you make the field required, but that only exist on the table design side. How can you make a combo box required?

thanks
 
One way is to have some code that checks the value before the form is closed.

Code:
If IsNull([YourField]) Then

MsgBox "Error"

End If


Col
 
You could also, within the form's On Current event set the focus to the combo box and not let the user pass go until they make a selection. The problem with this is that if they accidentally found themselves in that position, they would need to make a selection to close the form and so if they made a selection you could end up with records that were started but not finished. You could check in the form's Before Update event to see if all fields you need are entered, but you should always give the user a way out as well.
 
One way is to have some code that checks the value before the form is closed.

Code:
If IsNull([YourField]) Then

MsgBox "Error"

End If


Col

So Col I can add this to all my fields and each one will be requried, does this work on all fields...combos, text?

This is exactly what I need.
 
So Col I can add this to all my fields and each one will be requried, does this work on all fields...combos, text?

This is exactly what I need.

How do I use this code? where do I enter it in?
 

Users who are viewing this thread

Back
Top Bottom