473,397 Members | 1,950 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,397 software developers and data experts.

Checkboxes

Please could someone help. Here is the code we've placed in the command button for a form entitled Intelligent Personality Checker. There are three check-boxes Cinema, Mobile Phones & Beer & Food, also a text box. A command button entitled Process is supposed to put aforementioned text into the text box when the command button (btnProcess) is pressed but it doesn't work.
Can anyone give any clues as to why this doesnt function? I've inserted the code
below into the command-click box to no effect..........


Expand|Select|Wrap|Line Numbers
  1. Private Sub btnProcess_Click()
  2.    txtResult.Text = "................."
  3.    If Check1.Checked Then
  4.       txtResult.Text += "Cinema"
  5.    End If
  6.    If Check2.Checked Then
  7.       txtResult.Text += "Mobiles"
  8.    End If
  9.    If Check3.Checked Then
  10.       txtResult.Text += "Beer and Food"
  11.    End If
  12.    txtResult.Text += "........You really must get a life"
  13. End Sub
Feb 2 '07 #1
9 1389
hariharanmca
1,977 1GB
Please could someone help. Here is the code we've placed in the command button for a form entitled Intelligent Personality Checker. There are three check-boxes Cinema, Mobile Phones & Beer & Food, also a text box. A command button entitled Process is supposed to put aforementioned text into the text box when the command button (btnProcess) is pressed but it doesn't work.
Can anyone give any clues as to why this doesnt function? I've inserted the code
below into the command-click box to no effect..........


Private Sub btnProcess_Click()
txtResult.Text = "................."
If Check1.Checked Then
txtResult.Text += "Cinema"
End If
If Check2.Checked Then
txtResult.Text += "Mobiles"
End If
If Check3.Checked Then
txtResult.Text += "Beer and Food"
End If
txtResult.Text += "........You really must get a life"




End Sub

it doesn't work???, Is this method did not responce any reply...?
Feb 2 '07 #2
willakawill
1,646 1GB
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnProcess_Click()
  2.    txtResult.Text = "................."
  3.    If Check1.Checked Then
  4.       txtResult.Text += "Cinema"
  5.    End If
  6.    If Check2.Checked Then
  7.       txtResult.Text += "Mobiles"
  8.    End If
  9.    If Check3.Checked Then
  10.       txtResult.Text += "Beer and Food"
  11.    End If
  12.    txtResult.Text += "........You really must get a life"
  13. End Sub
Hi. You are using a c operator '+='. This does not exist in vb. Try this instead:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnProcess_Click()
  2.    txtResult.Text = "................."
  3.    If Check1.Checked Then
  4.       txtResult.Text =  txtResult.Text & "Cinema"
  5.    End If
  6.    If Check2.Checked Then
  7.       txtResult.Text =  txtResult.Text & "Mobiles"
  8.    End If
  9.    If Check3.Checked Then
  10.       txtResult.Text =  txtResult.Text & "Beer and Food"
  11.    End If
  12.    txtResult.Text =  txtResult.Text & "........You really must get a life"
  13. End Sub
Feb 2 '07 #3
hariharanmca
1,977 1GB
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnProcess_Click()
  2.    txtResult.Text = "................."
  3.    If Check1.Checked Then
  4.       txtResult.Text += "Cinema"
  5.    End If
  6.    If Check2.Checked Then
  7.       txtResult.Text += "Mobiles"
  8.    End If
  9.    If Check3.Checked Then
  10.       txtResult.Text += "Beer and Food"
  11.    End If
  12.    txtResult.Text += "........You really must get a life"
  13. End Sub
Hi. You are using a c operator '+='. This does not exist in vb. Try this instead:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnProcess_Click()
  2.    txtResult.Text = "................."
  3.    If Check1.Checked Then
  4.       txtResult.Text =  txtResult.Text & "Cinema"
  5.    End If
  6.    If Check2.Checked Then
  7.       txtResult.Text =  txtResult.Text & "Mobiles"
  8.    End If
  9.    If Check3.Checked Then
  10.       txtResult.Text =  txtResult.Text & "Beer and Food"
  11.    End If
  12.    txtResult.Text =  txtResult.Text & "........You really must get a life"
  13. End Sub
Hoooo....

But it will work in VB.Net...(i Thought its VB.Net Program)
Feb 2 '07 #4
Help I think its in Visual Basic6. Does this make any difference...........?
Feb 2 '07 #5
hariharanmca
1,977 1GB
Help I think its in Visual Basic6. Does this make any difference...........?

Yes sure that VB.Net will support OOPs Concept but VB won't support so it will no work
Feb 2 '07 #6
what should i do..................?
Feb 2 '07 #7
willakawill
1,646 1GB
what should i do..................?
Did you try the code I posted for you?
The button click event syntax that you posted is vb6, not .net
Feb 2 '07 #8
Try this code
I don't know much more knowledge about vb but try this code

Expand|Select|Wrap|Line Numbers
  1. Private Sub btnProcess_Click()
  2. txtResult.Text = "................."
  3. If Check1.Checked Then
  4.    txtResult.Text = txtResult.Text & "Cinema"
  5. End If
  6. If Check2.Checked Then
  7.    txtResult.Text = txtResult.Text & "Mobiles"
  8. End If
  9. If Check3.Checked Then
  10.    txtResult.Text = txtResult.Text & "Beer and Food"
  11. End If
  12. txtResult.Text = txtResult.Text & "........You really must get a life"
  13. End Sub
Feb 3 '07 #9
willakawill
1,646 1GB
Hi Pragash. You may notice that your reply is identical to the reply that I posted already.
Feb 3 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Pete | last post by:
There is a Summary/Example further down... On page one of my site I have a form with some checkboxes and detailed descriptions. When the form is submitted (to page two), the values of the...
8
by: DylanM | last post by:
I have some checkboxes that are generated from the results of a database search. At the moment, the checkboxes are part of a table making up a form. Users are going through the form, clicking the...
8
by: Ralph Freshour | last post by:
I have multiple checkbox's created with an array name because I have many on the same web page - their names are like: frm_chk_delete frm_chk_delete frm_chk_delete frm_chk_delete etc. Here...
5
by: @(none) | last post by:
I have a page which is a set of CheckBoxes generated daily and thus the number of Checkboxes changes each day. What I want to do is allow the user to select one or more checkboxes and the push a...
6
by: terence.parker | last post by:
I currently have the following JS in my header: function checkall(thestate) { var checkboxes=eval("document.forms.EssayList.file_id") for (i=0;i<checkboxes.length;i++)...
2
by: john | last post by:
I posted this question to comp.lang.javascript but didn't get a response, so I'll try here. I am using ASP.NET and I have a datagrid. One of the columns in my grid is all checkboxes. When the...
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
5
by: masterej | last post by:
Developers, Is there any way to disable all checkboxes on a form? I have a form with 160 checkboxes and I want to be able to disable all of them. Is there a way I can do something like this: ...
8
by: PeteOlcott | last post by:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_change_structure.html I would like to completely understand how GUI controls such as this one are constructed. In the...
7
by: viki1967 | last post by:
I need one function javascript that: 1) when I enter in this htm page I see enabled only checkbox of categories A, M and T; checkboxes of microcategories all disabled; 2-a) If I select the...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.