Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tick Boxes - Not being able to lost focus until one or more complete

Status
Not open for further replies.

Joanne

Programmer
Mar 7, 2000
3
GB
My name is Joanne and I have just started studying visual Basic 6. I would be very grateful to anyone that could help me to complete my database for my client in four days time. I have 8 tick boxes ("Yes/no" Data Types in the Table) on a form and I need to program the last tick box- To not proceed onto the next text box until one or more of the other tick boxes have been ticked. I have checked all my books to much avail. Can anyone give me some advise?
 
Hi Joanne,
one thing you could do is set the text box's enabled property to false (found under the data tab of the properties). This would grey out the text box and not let anyone enter data into it.
You could then set the afterupdate event of each tick box to check and see if it has been ticked. If it has you can enable the text box. This would allow entry into the text box as soon as one of the boxes is ticked.
Alternatively you can just set the afterupdate event of the last tick box to check if any of them has been ticked then enable the text box.

The code for enabling the text box is:
Code:
Me.text1.enabled = true
replace the text1 with the name of the textbox on the form.
If you need any more help let me know,
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top