How do I highlight the label for a text box control with focus?

G

Guest

I am creating a questionairre and the label contains the question that the
interviewer needs to ask and the associated text box is where they type the
answer. Is there an easy way to set focus on the label for each control as
the interviewer tabs through? I have only figured out to enter code in the
On Got Focus and On Lost Focus event procedures but this is very time
consuming!
Private Sub CityBorn_GotFocus()
Me.lblCityBorn.BackColor = vbGreen
End Sub

Private Sub CityBorn_LostFocus()
Me.lblCityBorn.BackColor = 12632256
End Sub
Thanks!
 
G

Guest

Hi

Can I make a suggestion. This is not the best method to use - writing
questions on Lables.

You may want to look at createing a table ( tblQuestions )
Have these fields
QuestionID = Autonumber
QuestionTip = This is the question that is asked
QuestionResult. = This is the answer that is given.

As you can see using this table you can set the answers to be eiher text or
number or date or whatever you can also speed up the process by using combo
boxes or list to record results.

Create a form from this and then simply tab though the form. You can use
Condidtional Formating to change the colour when [QuestionTip] has the
forcus. If you set the Tab order correctly you will be able to press the Tab
button to go through the form from each tip to the corresponding
[QuestionResult] and then on to the next tip.

Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top