restricting entry in text box

lmnop7854

Quittin' Time
Local time
Yesterday, 19:19
Joined
Nov 30, 2004
Messages
313
I would like to restrict users from being able to enter anything in certain controls, based on the data entered in a previous control. For instance, I have a questionnaire-type of form, and one question, when answered "no", should tab past a few questions. I have the SetFocus coded so that it tabs past the questions, but is there a way that I can restrict entry in the skipped controls? I read something about this previously, but no matter how hard I try, I can't find it when I search. Any help would be greatly appreciated. Thanks!

Lisa :)
 
Restrict

May be you can disable certain fields, based on the value of another.

In the After Update Event of a field you can put something like this:

If Me.FieldOne = "yes" Then
Me.FieldTwo.Enabled = False
Me.FieldThree.SetFocus
Else
End If
 
Ok, trucktime, once again, YOU ROCK! Worked like a charm. Now I have another question, since you have been on a roll with answers to my questions for the past few days.

Now, for the rest of the Yes/No questions on my forms, if they are answered NO, I need to create a message box that forces the user to add comments in the comments field for that question. I have a lot of questions, so is there a way to do this for all of them, so I don't have to copy and paste code for another 100 questions?

Thanks again,

Lisa
 
Message Box

I suppose you can put some code in the Before Update Event of the form that loops through all fields and pops up a messagebox when it finds a No answer.

I'm afraid you need someone with more knowledge to help you out with that.
Pat or GHudson may want to look into this.

Anyway, I'm glad I was able to help you this far. :)
 

Users who are viewing this thread

Back
Top Bottom