Make the Check Box required & change Label Text color to Red.

  • Thread starter Thread starter cw via AccessMonster.com
  • Start date Start date
C

cw via AccessMonster.com

I have a Check Box (Check465) with it's associated Label (Label466) on my
form.
with this code:

-----------------------
Private Sub Check465_AfterUpdate()
If MsgBox("Checking this box means the Customer has authorized Clearwave to
obtain credit info?", vbYesNo, "Confirm") <> vbYes Then
Cancel = True
Me.Undo
End If
End Sub
----------------------

How change it to do the following when a User tabs to it:
1) Make the Label466 text go to Red
2) Force user to check the box
3) Don't allow user to tab past, click past with mouse etc.

I have the Tab order of the Form set to the correct order, but it's very hard
to see which Check Box your on.

Thanks,
cw
 
What's the reason for forcing them to check a checkbox? There doesn't seem
to be any point in it if it must be checked!

The "trick" to changing a label's colour is the fact that by default, labels
are set to Transparent. Not only do you need to change the label's
BackColor, you also need to change its BackStyle:


Private Sub Check465_Enter()

Me.Label466.BackColor = RGB(255,0,0)
Me.Label466.BackStyle = 1

End Sub

You'll probably also want to change the colour back when you exit the
checkbox:

Private Sub Check465_Exit()

Me.Label466.BackStyle = 0

End Sub
 
Douglas, Thanks for the help. Your code worked fine. I used the following
code:
----------------------------------------
Private Sub Check469_AfterUpdate()
If MsgBox("Checking this box means the Customer has authorized Clearwave to
obtain credit info?", vbYesNo, "Confirm") <> vbYes Then
Cancel = True
Me.Undo
End If
End Sub

Private Sub Check469_Enter()
Me.Label470.BackColor = RGB(255, 0, 0)
Me.Label470.BackStyle = 1
End Sub

Private Sub Check469_Exit(Cancel As Integer)
Me.Label470.BackStyle = 0
End Sub
-------------------------------------
What the my Dept manager wants is for the end-user to be forced to
1) STOP at this box,
2) Ask the customer a question
3) Then pop-up the Message box, click yes & check the Box.

Only then can the User move past this section.
What do you think?
Thanks again,
CW
What's the reason for forcing them to check a checkbox? There doesn't seem
to be any point in it if it must be checked!

The "trick" to changing a label's colour is the fact that by default, labels
are set to Transparent. Not only do you need to change the label's
BackColor, you also need to change its BackStyle:

Private Sub Check465_Enter()

Me.Label466.BackColor = RGB(255,0,0)
Me.Label466.BackStyle = 1

End Sub

You'll probably also want to change the colour back when you exit the
checkbox:

Private Sub Check465_Exit()

Me.Label466.BackStyle = 0

End Sub
I have a Check Box (Check465) with it's associated Label (Label466) on my
form.
[quoted text clipped - 22 lines]
Thanks,
cw
 
Try putting your question in the Enter event.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


cw via AccessMonster.com said:
Douglas, Thanks for the help. Your code worked fine. I used the following
code:
----------------------------------------
Private Sub Check469_AfterUpdate()
If MsgBox("Checking this box means the Customer has authorized Clearwave to
obtain credit info?", vbYesNo, "Confirm") <> vbYes Then
Cancel = True
Me.Undo
End If
End Sub

Private Sub Check469_Enter()
Me.Label470.BackColor = RGB(255, 0, 0)
Me.Label470.BackStyle = 1
End Sub

Private Sub Check469_Exit(Cancel As Integer)
Me.Label470.BackStyle = 0
End Sub
-------------------------------------
What the my Dept manager wants is for the end-user to be forced to
1) STOP at this box,
2) Ask the customer a question
3) Then pop-up the Message box, click yes & check the Box.

Only then can the User move past this section.
What do you think?
Thanks again,
CW
What's the reason for forcing them to check a checkbox? There doesn't seem
to be any point in it if it must be checked!

The "trick" to changing a label's colour is the fact that by default, labels
are set to Transparent. Not only do you need to change the label's
BackColor, you also need to change its BackStyle:

Private Sub Check465_Enter()

Me.Label466.BackColor = RGB(255,0,0)
Me.Label466.BackStyle = 1

End Sub

You'll probably also want to change the colour back when you exit the
checkbox:

Private Sub Check465_Exit()

Me.Label466.BackStyle = 0

End Sub
I have a Check Box (Check465) with it's associated Label (Label466) on my
form.
[quoted text clipped - 22 lines]
Thanks,
cw
 
Back
Top