Set Border Color Property with VBA for Option Group

V

Van W

I've developed a test form with Option Groups containing check boxes. For the
ease of the end user, I'm trying to change the color of the border when a
user has chosen an option within a group. I've tried using an After Update
event procedure behind the Option Group with the following code to no avail.
Option Group name is Frame35. Color for border is blue (16711680). Normal
setting with no color is 0.

Private Sub Frame35_AfterUpdate()
If IsNull([Frame35]) = False then
Me!Frame35.BorderColor = 16711680
Else
Me!Frame35.BorderColor = 0
End If
End Sub

Nothing happens. I even tried just adding Me!Frame35.BorderColor = 16711680
after all of the diffent events behind the Option Group and nothing changes
the border color. How can I use VBA to change to border color of the option
group after a user selects a choice within that group?
Thanks for any help
 
M

Marshall Barton

Van said:
I've developed a test form with Option Groups containing check boxes. For the
ease of the end user, I'm trying to change the color of the border when a
user has chosen an option within a group. I've tried using an After Update
[snip]

I tried to answer this question in one of your other
duplicate posts yesterday. Check back through your previous
posts for replies and try to maintain some continuity by
keeping any followup questions to a single thread.
 
V

Van W

Reply to Marsh (MVP): Hi Marsh, tried the following code, still getting no
color change after checking box in Option Group.

Private Sub Frame35_AfterUpdate()
If IsNull([Frame35]) = False Then
Me!Frame35.SpecialEffect = 0
Me!Frame35.BorderColor = 16711680
Else
Me!Frame35.SpecialEffect = 3
Me!Frame35.BorderColor = 0
End If
End Sub


I even set a break code point in the If statement to see if it even accessed
to code after checking the box, but code does not even break! If you have any
other idease, please post.
thanks,
 
V

Van W

To Marsh (MVP): YeaaaaaaaaaaaaaaH!!!!!!!! Finally worked when I change event
procedure to Click from After Update. Thanks for the help
 
M

Marshall Barton

Van said:
Reply to Marsh (MVP): Hi Marsh, tried the following code, still getting no
color change after checking box in Option Group.

Private Sub Frame35_AfterUpdate()
If IsNull([Frame35]) = False Then
Me!Frame35.SpecialEffect = 0
Me!Frame35.BorderColor = 16711680
Else
Me!Frame35.SpecialEffect = 3
Me!Frame35.BorderColor = 0
End If
End Sub


I even set a break code point in the If statement to see if it even accessed
to code after checking the box, but code does not even break! If you have any
other idease, please post.
thanks,


That code works in my test. Are you sure the event property
contains [Event Procedure]?
 

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