Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Option Button Stays selected

Hi again,
I have 3 option buttons (optDelivery, optPickup and optTable) in a frame
(fraType). All are set to value = False on initialise.
However when optDelivery is selected via click or space bar and then either
of the other 2 are selected optDelivery stays selected.
I need it to only ever be 1 of the 3 as selected.
I have this in userform_initialise:
.... Me.optCash.Value = False
Me.optCheque.Value = False
Me.optCreditCard.Value = False
Me.optDelivery.Value = False
Me.optPickup.Value = False
Me.optTable.Value = False
If Me.optTable.Value = False Then
Me.txtnumberattable.Visible = False
End If

and this in cmdAdd_click()
.... If optDelivery = True Then
ActiveCell.Offset(0, 9).Value = "Y"
ElseIf optPickup = True Then
ActiveCell.Offset(0, 10).Value = "Y"
ElseIf optTable = True Then
ActiveCell.Offset(0, 11).Value = "Y"
End If
If optTable = True Then
ActiveCell.Offset(0, 12).Value = Me.txtnumberattable
End If

Any suggestions???

Thanks once again
Rachel
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 207
Default Option Button Stays selected

Rachel,
You need to tell your form what you want.
Me.optDelivery.Value = False
If Me.optDelivery = True Then
Me.optPickup.Value = False
Me.optTable.Value = False

End If
If Me.optPickup.Value = True Then
Me.optDelivery.Value = False
Me.optTable.Value = False

End If
If Me.optTable.Value = True Then
Me.optDelivery.Value = False
Me.optPickup.Value = False

End If

hth
"Rachel" wrote:

Hi again,
I have 3 option buttons (optDelivery, optPickup and optTable) in a frame
(fraType). All are set to value = False on initialise.
However when optDelivery is selected via click or space bar and then either
of the other 2 are selected optDelivery stays selected.
I need it to only ever be 1 of the 3 as selected.
I have this in userform_initialise:
... Me.optCash.Value = False
Me.optCheque.Value = False
Me.optCreditCard.Value = False
Me.optDelivery.Value = False
Me.optPickup.Value = False
Me.optTable.Value = False
If Me.optTable.Value = False Then
Me.txtnumberattable.Visible = False
End If

and this in cmdAdd_click()
... If optDelivery = True Then
ActiveCell.Offset(0, 9).Value = "Y"
ElseIf optPickup = True Then
ActiveCell.Offset(0, 10).Value = "Y"
ElseIf optTable = True Then
ActiveCell.Offset(0, 11).Value = "Y"
End If
If optTable = True Then
ActiveCell.Offset(0, 12).Value = Me.txtnumberattable
End If

Any suggestions???

Thanks once again
Rachel

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Option Button Stays selected

Thanks JP and FloMM2.
I adjusted your code a little and it is now working.

Cheers :)

"JP Ronse" wrote:

Hi Rachel,

I quickly rebuild your form and paste the code behind and do not have the
issue that the optDelivery stays selected when selecting one of both others.
It is when I drop optDelivery out of the frame. Are you sure they are all 3
in the same frame?

If you don't mind to send the file, you can do it to and
I will have a look into.

Wkr,

JP


"Rachel" wrote in message
...
Hi again,
I have 3 option buttons (optDelivery, optPickup and optTable) in a frame
(fraType). All are set to value = False on initialise.
However when optDelivery is selected via click or space bar and then
either
of the other 2 are selected optDelivery stays selected.
I need it to only ever be 1 of the 3 as selected.
I have this in userform_initialise:
... Me.optCash.Value = False
Me.optCheque.Value = False
Me.optCreditCard.Value = False
Me.optDelivery.Value = False
Me.optPickup.Value = False
Me.optTable.Value = False
If Me.optTable.Value = False Then
Me.txtnumberattable.Visible = False
End If

and this in cmdAdd_click()
... If optDelivery = True Then
ActiveCell.Offset(0, 9).Value = "Y"
ElseIf optPickup = True Then
ActiveCell.Offset(0, 10).Value = "Y"
ElseIf optTable = True Then
ActiveCell.Offset(0, 11).Value = "Y"
End If
If optTable = True Then
ActiveCell.Offset(0, 12).Value = Me.txtnumberattable
End If

Any suggestions???

Thanks once again
Rachel



.

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
Form - Get Selected (true) value of Option Button MM User Excel Programming 17 September 8th 08 12:43 PM
Excel sheets should move while selected cell stays in middle 804George Excel Discussion (Misc queries) 0 September 21st 06 06:40 PM
Option Button - multiple selected alanap Excel Worksheet Functions 1 April 17th 06 11:04 PM
If option button not selected Hywel[_2_] Excel Programming 2 November 8th 05 09:32 AM
Having a macro recognize when an option button has been selected Linking to specific cells in pivot table Excel Programming 3 August 26th 05 05:21 PM


All times are GMT +1. The time now is 06:45 PM.

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

About Us

"It's about Microsoft Excel"