Require field only if specific combo selection made

outofpractice

Registered User.
Local time
Today, 09:58
Joined
May 10, 2011
Messages
32
Thanks in advance for any assistance with this - and I browsed through the forms sections but did not see an answer to this.

My form has a combo box (Reason) and several text fields on it. What I would like to happen is if Reason 1 is selected, then Text_Field1 becomes required. If any reason other than 1 is selected, then Text_Field1 may be blank.

It seems like this should probably be pretty simple but I've not had any luck in figuring out how to do this.

Thanks again!
 
pbaldy -

I'm not to experienced with VB and am not sure what the first line should say. I have the message appearing and moving the cursor to the appropriate field if the correct value is selected in the combo box. However, I do not know how to make it recognize that the field has information in it - the message just keeps appearing. I believe my problem is I do not know how to use the vbNullString command.

I changed the first line as indicated in red below. The field which must have information in it only if Returned_Reason = 1 is called New_Address

If Len(Me.Returned_Reason & vbNullString) = 1 Then

How do I need to modify the above? Thanks
 
Try

If Me.ComboName = 1 Then

The test you have there would be used on the text box to make sure it contains something.
 

Users who are viewing this thread

Back
Top Bottom