[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Dick

1/1/2012 9:48:00 AM

I have a huge problem I just can not solve.I'm trying to concatinate
several things. I have a user form with 15 optionbuttons. If specific
optionbutton are clicked then do a certain thing.. Such as If
optionbutton1 is clicked then put Always"350" Optionbutton1 is always
"S" then whatever is in Label, Then IF optionbutton2 is selected
then
leave the "350", "S", whatever the label caption is and ad the other
optionbutton and attach it to the first one . Such as 350S2Z5. So
this
would be 2 optionbuttons that were selected. 350 then S then 2 was
the
label, then Z was the next option button and 5 was the label. And put
results in Sheet1 "J2" I have 15 combinations to do. Thanks for any
Help!!


16 Answers

MikeD

1/1/2012 3:38:00 PM

0



"Dick" <bobdelrn@yahoo.com> wrote in message
news:8ff50cbe-57b4-444f-a230-607580da867a@k28g2000yqn.googlegroups.com...
> I have a huge problem I just can not solve.I'm trying to concatinate
> several things. I have a user form with 15 optionbuttons. If specific
> optionbutton are clicked then do a certain thing.. Such as If
> optionbutton1 is clicked then put Always"350" Optionbutton1 is always
> "S" then whatever is in Label, Then IF optionbutton2 is selected
> then
> leave the "350", "S", whatever the label caption is and ad the other
> optionbutton and attach it to the first one . Such as 350S2Z5. So
> this
> would be 2 optionbuttons that were selected. 350 then S then 2 was
> the
> label, then Z was the next option button and 5 was the label. And put
> results in Sheet1 "J2" I have 15 combinations to do. Thanks for any
> Help!!
>
>

To concatenate strings, use the & operator. For example,

"Some text" & " some more text'

You never said exactly what problem you're having. You described what you
want to do, but not what problem you're having doing it. Second, I'd be
amazed if anybody can actually figure out what you're trying to do. There's
little of what you wrote that actually makes sense. You have to remember
that we're not mind readers. It might make perfect sense to you, but for
everyone else to understand, you have to be clear and concise. Just for an
example of what makes no sense, you said optionbutton1 is always "350" and
then say it's always "S". Huh? I'm also guessing you really don't even mean
option buttons but checkboxes. Only one option button out of a group of
option buttons can be selected. So assuming optionbutton1 and optionbutton2
are in the same group, only one of them can ever be selected.

--
Mike




Dick

1/1/2012 8:43:00 PM

0

On Jan 1, 10:37 am, "MikeD" <nob...@nowhere.edu> wrote:
> "Dick" <bobde...@yahoo.com> wrote in message
>
> news:8ff50cbe-57b4-444f-a230-607580da867a@k28g2000yqn.googlegroups.com...
>
>
>
>
>
> > I have a huge problem I just can not solve.I'm trying to concatinate
> > several things. I have a user form with 15 optionbuttons. If specific
> > optionbutton are clicked then do a certain thing.. Such as If
> > optionbutton1 is clicked then put Always"350" Optionbutton1 is always
> > "S" then whatever is in Label, Then IF  optionbutton2 is selected
> > then
> > leave the "350", "S", whatever the label caption is and ad the other
> > optionbutton and attach it to the first one . Such as 350S2Z5. So
> > this
> > would be 2 optionbuttons that were selected. 350 then S then 2 was
> > the
> > label, then Z was the next option button and 5 was the label. And put
> > results in Sheet1 "J2" I have 15 combinations to do. Thanks for any
> > Help!!
>
> To concatenate strings, use the & operator. For example,
>
> "Some text" & " some more text'
>
> You never said exactly what problem you're having. You described what you
> want to do, but not what problem you're having doing it. Second, I'd be
> amazed if anybody can actually figure out what you're trying to do.  There's
> little of what you wrote that actually makes sense.  You have to remember
> that we're not mind readers. It might make perfect sense to you, but for
> everyone else to understand, you have to be clear and concise.  Just for an
> example of what makes no sense, you said optionbutton1 is always "350" and
> then say it's always "S".  Huh? I'm also guessing you really don't even mean
> option buttons but checkboxes. Only one option button out of a group of
> option buttons can be selected. So assuming optionbutton1 and optionbutton2
> are in the same group, only one of them can ever be selected.
>
> --
> Mike- Hide quoted text -
>
> - Show quoted text -

1.Yes I do mean optionbuttons
2.Yes You can select more than one optionbutton by giving each one its
own unique name
3.As far as the "350" That will remain at the BEGINNING on all numbers
strings
4.What changes is whats after the "350" but I still need to
concastinate it.
5.Yes it can be very confusing for people like myself. Thats why I ask
for help.
6.Thanks for your help!

Bob Butler

1/1/2012 9:44:00 PM

0


"Dick" <bobdelrn@yahoo.com> wrote in message
news:139c8b0d-decf-4985-bccb-b5534cfc4cf4@24g2000yqi.googlegroups.com...
On Jan 1, 10:37 am, "MikeD" <nob...@nowhere.edu> wrote:
<cut>

> 1.Yes I do mean optionbuttons

Making option buttons act like checkboxes is likely to make your UI "feel
wrong" to a lot of users. It's rarely a good idea to make things behave in
a non-standard way.

> 2.Yes You can select more than one optionbutton by giving each one its
> own unique name

Not in VB. If you are using "VB.Net" then you are in the wrong place.

> 3.As far as the "350" That will remain at the BEGINNING on all numbers
> strings
> 4.What changes is whats after the "350" but I still need to
> concastinate it.

In VB (and if I understand the question)...

s="350"
if option1.value then s=s & "S"
if option2.value then s=s & "whatever"
etc


GS

1/1/2012 11:33:00 PM

0

Bob Butler brought next idea :
> "Dick" <bobdelrn@yahoo.com> wrote in message
> news:139c8b0d-decf-4985-bccb-b5534cfc4cf4@24g2000yqi.googlegroups.com...
> On Jan 1, 10:37 am, "MikeD" <nob...@nowhere.edu> wrote:
> <cut>
>
>> 1.Yes I do mean optionbuttons
>
> Making option buttons act like checkboxes is likely to make your UI "feel
> wrong" to a lot of users. It's rarely a good idea to make things behave in a
> non-standard way.
>
>> 2.Yes You can select more than one optionbutton by giving each one its
>> own unique name
>
> Not in VB. If you are using "VB.Net" then you are in the wrong place.

In VB.Net these are termed 'RadioButton'.

In VBA (not VB) we can assign a separate 'GroupName' to each
OptionButton so they behave like checkboxes, though this is not
conventional use of that control since their intent is to let users
know the choices aren't multi-select. To get the same behavior in VB or
VB.Net would require separate containers for each control.

Even if they were members of the same group (like VB or VB.Net), the
concatenation can still be achieved by using each one's '_Click' event
in turn. However, we won't know which one[s] were clicked since only
one can be selected at a time unless some visual clue was implemented
(ie: disabled or change font color if selected).

>
>> 3.As far as the "350" That will remain at the BEGINNING on all numbers
>> strings
>> 4.What changes is whats after the "350" but I still need to
>> concastinate it.
>
> In VB (and if I understand the question)...
>
> s="350"
> if option1.value then s=s & "S"
> if option2.value then s=s & "whatever"
> etc

I suspect the OP is making an app for selecting ordering options that
built an 'order code' of some sort. This, of course, requires following
a specific assembly structure for the order code which is better
managed using an arry to hold the values for each selection via some
mechanism to determine their respective index in the array so the
Join() function assembles it correctly after all selections are made.

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc


phil hunt

1/1/2012 11:47:00 PM

0

don't know exactly what you are trying to do. But you should not use the
click event to avoid user change mind and uncheck something. So do the
conact in the final act.


GS

1/2/2012 7:19:00 AM

0

phil hunt laid this down on his screen :
> don't know exactly what you are trying to do. But you should not use the
> click event to avoid user change mind and uncheck something. So do the conact
> in the final act.

I'm not trying to do anything! I agree that option buttons are not the
way to go about whatever the OP is attempting to do, and I definitely
agree some mechanism needs to be in place to allow changing one's mind
about selections. I was merely trying to convey possible ways the OP
could be using OptionButton controls to 'effect' what he claims is how
they're being used. In the case of using the click event, if the array
index already contains a value then it can be cleared. Obviously a
textbox or label that updates as the user makes selections would be
prudent regardless of how the details are managed for the final result.
<IMO>

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc


MikeD

1/2/2012 2:31:00 PM

0



"Dick" <bobdelrn@yahoo.com> wrote in message
news:139c8b0d-decf-4985-bccb-b5534cfc4cf4@24g2000yqi.googlegroups.com...
>
> 1.Yes I do mean optionbuttons

Then as Bob said, your UI is going to be very confusing to most users
because that's not a conventional use of option buttons. Option buttons are
used to select 1 out of a group of similar items.

> 2.Yes You can select more than one optionbutton by giving each one its
> own unique name

As also already said, not in VB. But I get the impression you're using VBA
in Excel (reference to Sheet1 "J2" in your original post). There are
differences between VBA and VB so if you're using VBA you need to be clear
about that and tell us what program you're using VBA in. And what you say is
not correct in Excel 2010. I just checked by adding 2 option buttons to a
userform and selecting 1 of them (clicking it or otherwise setting its Value
property to True) deselects the other (its Value property becomes False). If
by chance you are using VB.NET (at least in VB 2008 and VB 2010), then it is
possible to have multiple option buttons (but they're called RadioButtons)
placed in the same container selected by setting their AutoCheck property to
False. Why anyone would want to do that is beyond me.



> 3.As far as the "350" That will remain at the BEGINNING on all numbers
> strings
> 4.What changes is whats after the "350" but I still need to
> concastinate it.
> 5.Yes it can be very confusing for people like myself. Thats why I ask
> for help.

And that's why some of us still read newsgroup even though they're basically
dead. But you still haven't asked a question or described the actual problem
you're having so we're still not sure exactly what you need help doing,
which is pretty much evident by the other replies you've gotten. We can't
help you if we don't understand what you're trying to do and what problem(s)
you're having in doing it.

--
Mike


GS

1/2/2012 7:27:00 PM

0

MikeD has brought this to us :
> I just checked by adding 2 option buttons to a userform and selecting 1 of
> them (clicking it or otherwise setting its Value property to True) deselects
> the other (its Value property becomes False).

Mike,
If you assign different values to the OptionButton.GroupName property
you can select each one same as if using checkboxes. The GroupName
property allows using different groups of OptionButtons in the same
container. Note that the normal behavior of unique selection applies to
the OptionButtons sharing the same GroupName, regardless of how/where
they're placed on the userform.

As Phil suggests, and I agree, to support you in stating this is an
unconventional way to use this control. Surely a listbox with checked
items and MultiSelect set to True would be much easier to work with and
definitely less confusing to the user. I still think, however, that
something like a label should be used to display the progress of the
concatenation as users select/deselect choices so they know the result
before committing it elsewhere.

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc


MikeD

1/2/2012 8:08:00 PM

0



"GS" <gs@somewhere.net> wrote in message news:jdt0eh$uos$1@dont-email.me...
> MikeD has brought this to us :
>> I just checked by adding 2 option buttons to a userform and selecting 1
>> of them (clicking it or otherwise setting its Value property to True)
>> deselects the other (its Value property becomes False).
>
> Mike,
> If you assign different values to the OptionButton.GroupName property you
> can select each one same as if using checkboxes. The GroupName property
> allows using different groups of OptionButtons in the same container. Note
> that the normal behavior of unique selection applies to the OptionButtons
> sharing the same GroupName, regardless of how/where they're placed on the
> userform.

Well I'll be. I don't think I ever noticed that property before. Thanks for
pointing it out.

--
Mike


GS

1/2/2012 10:31:00 PM

0

MikeD formulated on Monday :
>
> "GS" <gs@somewhere.net> wrote in message news:jdt0eh$uos$1@dont-email.me...
>> MikeD has brought this to us :
>>> I just checked by adding 2 option buttons to a userform and selecting 1 of
>>> them (clicking it or otherwise setting its Value property to True)
>>> deselects the other (its Value property becomes False).
>>
>> Mike,
>> If you assign different values to the OptionButton.GroupName property you
>> can select each one same as if using checkboxes. The GroupName property
>> allows using different groups of OptionButtons in the same container. Note
>> that the normal behavior of unique selection applies to the OptionButtons
>> sharing the same GroupName, regardless of how/where they're placed on the
>> userform.
>
> Well I'll be. I don't think I ever noticed that property before. Thanks for
> pointing it out.

You're welcome!
I find it saves having to unecessarily bloat a VBA project with extra
controls just to act as group containers for OptionButtons<g>!

--
Garry

Free usenet access at http://www.eternal-sep...
ClassicVB Users Regroup! comp.lang.basic.visual.misc