473,394 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Need help with a Combobox

I have a question for people out there, I need the Combobox to change a
label caption when the user picks a certain thing from the list. How do I
code this. I've tried an If Then statement, but it doesn't seem to work.
Somebody please help!

Sep 7 '06 #1
12 3543
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:
I have a question for people out there, I need the Combobox to change a
label caption when the user picks a certain thing from the list. How do I
code this. I've tried an If Then statement, but it doesn't seem to work.
Somebody please help!
Post the code that doesn't work.

Anyway,

Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub

Jan Hyde (VB MVP)

--
Man with hole in pocket feel cocky all day.

Sep 7 '06 #2
Sorry I should have been more specific, When the User picks from a list of
provinces, the label changes to a different tax rate. Like when they pick
"AB" then the label says "6%"

"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:r1********************************@4ax.com...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:
> I have a question for people out there, I need the Combobox to change a
label caption when the user picks a certain thing from the list. How do I
code this. I've tried an If Then statement, but it doesn't seem to work.
Somebody please help!

Post the code that doesn't work.

Anyway,

Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub

Jan Hyde (VB MVP)

--
Man with hole in pocket feel cocky all day.

Sep 7 '06 #3
sorry, the code that doesnt work is

Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"
End Sub
"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:r1********************************@4ax.com...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:
> I have a question for people out there, I need the Combobox to change a
label caption when the user picks a certain thing from the list. How do I
code this. I've tried an If Then statement, but it doesn't seem to work.
Somebody please help!

Post the code that doesn't work.

Anyway,

Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub

Jan Hyde (VB MVP)

--
Man with hole in pocket feel cocky all day.

Sep 7 '06 #4
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 13:43:37 GMT bearing the
following fruit:
>sorry, the code that doesnt work is

Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"
If cboProvince.Text = "AB" then LblTax.Caption = "6%"


>End Sub
"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:r1********************************@4ax.com.. .
>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:
>> I have a question for people out there, I need the Combobox to change a
label caption when the user picks a certain thing from the list. How do I
code this. I've tried an If Then statement, but it doesn't seem to work.
Somebody please help!

Post the code that doesn't work.

Anyway,

Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub

Jan Hyde (VB MVP)

--
Man with hole in pocket feel cocky all day.

Jan Hyde (VB MVP)

--
“He’s making a list of chicken and rice,” (Richard Lederer)

Sep 7 '06 #5
huh, thats the same code that i used, doesn't work

"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:om********************************@4ax.com...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 13:43:37 GMT bearing the
following fruit:
>>sorry, the code that doesnt work is

Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"

If cboProvince.Text = "AB" then LblTax.Caption = "6%"


>>End Sub
"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:r1********************************@4ax.com. ..
>>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:

I have a question for people out there, I need the Combobox to change
a
label caption when the user picks a certain thing from the list. How do
I
code this. I've tried an If Then statement, but it doesn't seem to work.
Somebody please help!
Post the code that doesn't work.

Anyway,

Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub

Jan Hyde (VB MVP)

--
Man with hole in pocket feel cocky all day.


Jan Hyde (VB MVP)

--
"He's making a list of chicken and rice," (Richard Lederer)

Sep 7 '06 #6
Sorry for the top post.. how about..

Private Sub cboProvince_Click()
if cboProvince.List(cboProvince.ListIndex) = "AB" then LblTax.Caption =
"6%"
' ... etc.
End Sub
"What the Hell?" <ra**********@gmail.comwrote in message
news:uN1Mg.37$E67.17@clgrps13...
huh, thats the same code that i used, doesn't work

"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:om********************************@4ax.com...
>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 13:43:37 GMT bearing the
following fruit:
>>>sorry, the code that doesnt work is

Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"

If cboProvince.Text = "AB" then LblTax.Caption = "6%"


>>>End Sub
"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:r1********************************@4ax.com ...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:

I have a question for people out there, I need the Combobox to
change a
>label caption when the user picks a certain thing from the list. How do
>I
>code this. I've tried an If Then statement, but it doesn't seem to
>work.
>Somebody please help!
>

Post the code that doesn't work.

Anyway,

Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub

Jan Hyde (VB MVP)

--
Man with hole in pocket feel cocky all day.



Jan Hyde (VB MVP)

--
"He's making a list of chicken and rice," (Richard Lederer)


Sep 7 '06 #7
THANX! That helped SOOO much!

"Raoul Watson" <Wa*****@IntelligenCIA.comwrote in message
news:K22Mg.9251$ay1.3085@trndny08...
Sorry for the top post.. how about..

Private Sub cboProvince_Click()
if cboProvince.List(cboProvince.ListIndex) = "AB" then LblTax.Caption
= "6%"
' ... etc.
End Sub
"What the Hell?" <ra**********@gmail.comwrote in message
news:uN1Mg.37$E67.17@clgrps13...
>huh, thats the same code that i used, doesn't work

"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:om********************************@4ax.com.. .
>>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 13:43:37 GMT bearing the
following fruit:

sorry, the code that doesnt work is

Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"

If cboProvince.Text = "AB" then LblTax.Caption = "6%"

End Sub
"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:r1********************************@4ax.co m...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:
>
> I have a question for people out there, I need the Combobox to
>change a
>>label caption when the user picks a certain thing from the list. How
>>do I
>>code this. I've tried an If Then statement, but it doesn't seem to
>>work.
>>Somebody please help!
>>
>
Post the code that doesn't work.
>
Anyway,
>
Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub
>
>
>
Jan Hyde (VB MVP)
>
--
Man with hole in pocket feel cocky all day.
>

Jan Hyde (VB MVP)

--
"He's making a list of chicken and rice," (Richard Lederer)



Sep 7 '06 #8
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 23:18:50 GMT bearing the
following fruit:
>huh, thats the same code that i used, doesn't work
Then why isn't that the code you posted?

It's important you post your actual code.

J
>"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:om********************************@4ax.com.. .
>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 13:43:37 GMT bearing the
following fruit:
>>>sorry, the code that doesnt work is

Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"

If cboProvince.Text = "AB" then LblTax.Caption = "6%"


>>>End Sub
"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:r1********************************@4ax.com ...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:

I have a question for people out there, I need the Combobox to change
a
>label caption when the user picks a certain thing from the list. How do
>I
>code this. I've tried an If Then statement, but it doesn't seem to work.
>Somebody please help!
>

Post the code that doesn't work.

Anyway,

Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub

Jan Hyde (VB MVP)

--
Man with hole in pocket feel cocky all day.



Jan Hyde (VB MVP)

--
"He's making a list of chicken and rice," (Richard Lederer)

Jan Hyde (VB MVP)

--
The poet had written better poems, but he'd also written verse.

Sep 8 '06 #9
look who cares, the problem is solved now, if you read the last 2 posts, so
why even bother posting that reply
"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:m4********************************@4ax.com...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 23:18:50 GMT bearing the
following fruit:
>>huh, thats the same code that i used, doesn't work

Then why isn't that the code you posted?

It's important you post your actual code.

J
>>"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:om********************************@4ax.com. ..
>>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 13:43:37 GMT bearing the
following fruit:

sorry, the code that doesnt work is

Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"

If cboProvince.Text = "AB" then LblTax.Caption = "6%"

End Sub
"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:r1********************************@4ax.co m...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
following fruit:
>
> I have a question for people out there, I need the Combobox to
>change
>a
>>label caption when the user picks a certain thing from the list. How
>>do
>>I
>>code this. I've tried an If Then statement, but it doesn't seem to
>>work.
>>Somebody please help!
>>
>
Post the code that doesn't work.
>
Anyway,
>
Private Sub Combo1_Click()
Label1.Caption = Combo1.Text
End Sub
>
>
>
Jan Hyde (VB MVP)
>
--
Man with hole in pocket feel cocky all day.
>

Jan Hyde (VB MVP)

--
"He's making a list of chicken and rice," (Richard Lederer)


Jan Hyde (VB MVP)

--
The poet had written better poems, but he'd also written verse.

Sep 8 '06 #10
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Fri, 08 Sep 2006 15:47:21 GMT bearing the
following fruit:
>look who cares, the problem is solved now, if you read the last 2 posts, so
why even bother posting that reply
To help you get the correct answer quicker in the future.

By not posting you exact code you also waste the time of
people trying to help you.

If you don't care that's fine, but you'll find less and less
people want to help you if you adopt that attitude.
J
>"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:m4********************************@4ax.com.. .
>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 23:18:50 GMT bearing the
following fruit:
>>>huh, thats the same code that i used, doesn't work

Then why isn't that the code you posted?

It's important you post your actual code.

J
>>>"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:om********************************@4ax.com ...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 13:43:37 GMT bearing the
following fruit:

>sorry, the code that doesnt work is
>
>Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"

If cboProvince.Text = "AB" then LblTax.Caption = "6%"

>End Sub
>"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
>news:r1********************************@4ax.c om...
>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
>were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
>following fruit:
>>
>> I have a question for people out there, I need the Combobox to
>>change
>>a
>>>label caption when the user picks a certain thing from the list. How
>>>do
>>>I
>>>code this. I've tried an If Then statement, but it doesn't seem to
>>>work.
>>>Somebody please help!
>>>
>>
>Post the code that doesn't work.
>>
>Anyway,
>>
>Private Sub Combo1_Click()
> Label1.Caption = Combo1.Text
>End Sub
>>
>>
>>
>Jan Hyde (VB MVP)
>>
>--
>Man with hole in pocket feel cocky all day.
>>
>
Jan Hyde (VB MVP)

--
"He's making a list of chicken and rice," (Richard Lederer)



Jan Hyde (VB MVP)

--
The poet had written better poems, but he'd also written verse.

Jan Hyde (VB MVP)

--
'Power corrupts. Absolute power is kind of neat, though.'

Sep 8 '06 #11
Jan Hyde wrote:
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Fri, 08 Sep 2006 15:47:21 GMT bearing the
following fruit:
>look who cares, the problem is solved now, if you read the last 2 posts, so
why even bother posting that reply

To help you get the correct answer quicker in the future.

By not posting you exact code you also waste the time of
people trying to help you.

If you don't care that's fine, but you'll find less and less
people want to help you if you adopt that attitude.
As should be listed on all support groups everywhere,

How To Ask Questions The Smart Way:
http://www.catb.org/~esr/faqs/smart-questions.html

--
Dean Earley (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems
Sep 8 '06 #12
Yea, I was going to tell him how to do it without any if or select
statements at all, but why bother with the attitude?

--

Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/

Please reply to the newsgroups so all can participate.


"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:0r********************************@4ax.com...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Fri, 08 Sep 2006 15:47:21 GMT bearing the
following fruit:
>look who cares, the problem is solved now, if you read the last 2 posts, so
why even bother posting that reply
To help you get the correct answer quicker in the future.

By not posting you exact code you also waste the time of
people trying to help you.

If you don't care that's fine, but you'll find less and less
people want to help you if you adopt that attitude.
J
>"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:m4********************************@4ax.com.. .
>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 23:18:50 GMT bearing the
following fruit:
>>>huh, thats the same code that i used, doesn't work

Then why isn't that the code you posted?

It's important you post your actual code.

J
>>>"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
news:om********************************@4ax.com ...
"What the Hell?" <ra**********@gmail.com>'s wild thoughts
were released on Thu, 07 Sep 2006 13:43:37 GMT bearing the
following fruit:

>sorry, the code that doesnt work is
>
>Private Sub cboProvince_Click()
If cboProvince.List = "AB" then LblTax.Caption = "6%"

If cboProvince.Text = "AB" then LblTax.Caption = "6%"

>End Sub
>"Jan Hyde" <St***********@REMOVE.ME.uboot.comwrote in message
>news:r1********************************@4ax.c om...
>"What the Hell?" <ra**********@gmail.com>'s wild thoughts
>were released on Thu, 07 Sep 2006 02:36:19 GMT bearing the
>following fruit:
>>
>> I have a question for people out there, I need the Combobox to
>>change
>>a
>>>label caption when the user picks a certain thing from the list. How
>>>do
>>>I
>>>code this. I've tried an If Then statement, but it doesn't seem to
>>>work.
>>>Somebody please help!
>>>
>>
>Post the code that doesn't work.
>>
>Anyway,
>>
>Private Sub Combo1_Click()
> Label1.Caption = Combo1.Text
>End Sub
>>
>>
>>
>Jan Hyde (VB MVP)
>>
>--
>Man with hole in pocket feel cocky all day.
>>
>
Jan Hyde (VB MVP)

--
"He's making a list of chicken and rice," (Richard Lederer)



Jan Hyde (VB MVP)

--
The poet had written better poems, but he'd also written verse.

Jan Hyde (VB MVP)

--
'Power corrupts. Absolute power is kind of neat, though.'

Sep 11 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Piet | last post by:
Hello wxPythoneers. I have a problem with a dialog box derived from wxFrame which has a wxComboBox as main element. Depending on the entry selected from the ComboBox, the dialog box will be...
17
by: Marcin Borkowski | last post by:
Hello I need some small help in the Borland C++ Builder. I need to do something with string in format like "var1|var2|var3|var4|" and add it to some ComboBox (Items -> Add("var1"), Items ->...
6
by: Andi Plotsky | last post by:
Hi - I sent this request last week, but didn't get an answer to my problem - let's try again: In my A2K database, I have a form with 2 Unbound Comboboxes, both of which open up forms to a...
11
by: my-wings | last post by:
I think I've painted myself into a corner, and I'm hoping someone can help me out. I have a table of books (tblBooks), which includes a field (strPubName) for Publisher Name and another field...
0
by: Jax | last post by:
I am using a class that inherits from the DataGridTextBoxColumn. It adds a combo box into the column where it displays a selection of choices. The problem I have is that when this comboBox loses...
1
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new...
17
by: Hazz | last post by:
In this sample code of ownerdraw drawmode, why does the '(ComboBox) sender' line of code need to be there in this event handler? Isn't cboFont passed via the managed heap, not the stack, into this...
4
by: jon f kaminsky | last post by:
Hi- I've seen this problem discussed a jillion times but I cannot seem to implement any advice that makes it work. I am porting a large project from VB6 to .NET. The issue is using the combo box...
3
by: Rick Shaw | last post by:
Hi. I am very new to C# and needed help. Use to program in Delphi but switching to C#. I am just starting my very first application and already don't know what to do. Here is what I'm trying to...
6
by: active | last post by:
I need a combobox where the items are typed as string - not object. And another where the items are from a class I generated. Can one make such comboboxes from System.Windows.Forms.ComboBox?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.