Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check box in user form


Hi

I have a user form with 2 check box, but i need help with some code
I want a error message to appear if box boxes are ticked or both are
not

Also how do unload check boxes and option buttons so after closing the
next person using the form has no choice but to select one (this is in
case someone select a option but the next person forgets to and leaves
the option before which is the wrong one for them!!!!) Hope that makes
sense

here is some of my code already

If Not (OptionButton6 Or OptionButton7) Then
MsgBox "No option for job type track only or compelet, please
select."
OptionButton6.SetFocus
Exit Sub

Thanks


--
raw
------------------------------------------------------------------------
raw's Profile: http://www.excelforum.com/member.php...o&userid=28312
View this thread: http://www.excelforum.com/showthread...hreadid=480443

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Check box in user form


"raw" wrote in message
...
I have a user form with 2 check box, but i need help with some code
I want a error message to appear if box boxes are ticked or both are
not


Private Sub CheckBox1_Click()
With Me
If .CheckBox1.Value = .CheckBox2.Value Then
MsgBox "Can't both be set/unset"
.CheckBox1.Value = Not .CheckBox2.Value
End If
End With
End Sub

Private Sub CheckBox2_Click()
With Me
If .CheckBox1.Value = .CheckBox2.Value Then
MsgBox "Can't both be set/unset"
.CheckBox2.Value = Not .CheckBox2.Value
End If
End With
End Sub

Trouble with this is that once you set one or other, you can never change it
as any other action triggers the error.

Also how do unload check boxes and option buttons so after closing the
next person using the form has no choice but to select one (this is in
case someone select a option but the next person forgets to and leaves
the option before which is the wrong one for them!!!!) Hope that makes
sense


Public Sub UserForm_Activate()
With Me
.CheckBox1.Value = False
.CheckBox2.Value = False
End With
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Check box in user form


Hello Raw,

You neeed to change the *OR* to *XOR*.

If Not (OptionButton6 Xor OptionButton7) Then

Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=48044

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
make a check form, and then have info go to a check register richie g Excel Worksheet Functions 0 May 5th 10 12:10 AM
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM


All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"