473,398 Members | 2,404 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,398 software developers and data experts.

list box values

553 512MB
Hi

I have 2 tick boxes (say A and B) and a list box. I want following, can anyone help

If tick-box A is checked: the list box will show all of its values

If tick-box B is checked: the list box will show only the first 2 values

I know how to write code for tick-boxes, please give help on doing the List Box

thanks
Jul 10 '07 #1
9 2383
Rabbit
12,516 Expert Mod 8TB
You'll want to change the list box's rowsource property from the on click event of the check box.
Jul 10 '07 #2
questionit
553 512MB
Rabbit

It wont be very useful in this case

Is there no way just to disable or to make invisible any of the value in the List box ??


You'll want to change the list box's rowsource property from the on click event of the check box.
Jul 10 '07 #3
Rabbit
12,516 Expert Mod 8TB
Rabbit

It wont be very useful in this case

Is there no way just to disable or to make invisible any of the value in the List box ??
Only if it's a Value List, then you can use Me.ListboxName.RemoveItem()
If it's Table/Query, you'll need to change the Row Source. They both have the same aesthetic effect.
Jul 10 '07 #4
questionit
553 512MB
Ok, but i have a problem with doing Rwresouce. See my code (it works OK but there is another problem):

Me.lst_Heating_Choice.RowSourceType = "Table/Query"
Me.lst_Heating_Choice.RowSource = "SELECT Heating_Choice_Index, Heating_Choice_Description FROM test WHERE Heating_Choice_Index=5
Me.lst_Heating_Choice.Requery

Since my List Box is setup to take upto 5 values and on the 5th value i have an condition written up for doing some other things as well.

When i run the above query, i am now getting only 1 value returned- so i cant do the check on the 5th value as when only 1 value is returned it is considered by List Box as the first value not the 5th one.

I think perhaps in this case, i would need to add NULLS in first 4 rows and then the 5th value will come to its proper place.. Is that right but how would i do that?


Thanks


Only if it's a Value List, then you can use Me.ListboxName.RemoveItem()
If it's Table/Query, you'll need to change the Row Source. They both have the same aesthetic effect.
Jul 10 '07 #5
Rabbit
12,516 Expert Mod 8TB
I'm not following. Can you give me an example?

What is an example of the values in the listbox when it loads. Then what should it look like after you click something?
Jul 10 '07 #6
questionit
553 512MB
For example, values are:

Value1
Value2
Value3

As i said , if Row 3 (Value3) is selected from ListBox then i call some functions to do some task

I have a button(its a part of requirement), when clicked, i am left with only Value3 in the ListBox . -- here comes the problem - Because Value3 is one only only value, it now comes on the first row of list box. So i cant do the above mentioned calling of funtions because now it is Value3 in Row 3 and previously it was Value1 in Row3 !! you know what i mean? I have conditions on row not on values

So i when i am in the case when there is only one value in List Box (in row 1), i would perhaps manually add 2 NULLS values so that Value3 comes back to its original place - Row 3 ---- If this is right, how can dio this



I'm not following. Can you give me an example?

What is an example of the values in the listbox when it loads. Then what should it look like after you click something?
Jul 10 '07 #7
Rabbit
12,516 Expert Mod 8TB
For example, values are:

Value1
Value2
Value3

As i said , if Row 3 (Value3) is selected from ListBox then i call some functions to do some task

I have a button(its a part of requirement), when clicked, i am left with only Value3 in the ListBox . -- here comes the problem - Because Value3 is one only only value, it now comes on the first row of list box. So i cant do the above mentioned calling of funtions because now it is Value3 in Row 3 and previously it was Value1 in Row3 !! you know what i mean? I have conditions on row not on values

So i when i am in the case when there is only one value in List Box (in row 1), i would perhaps manually add 2 NULLS values so that Value3 comes back to its original place - Row 3 ---- If this is right, how can dio this
Why are you doing the calculation based on row number rather than an ID of some sort?

Are you saying if the values were:
Value3
Value2
Value1

You would now do the calculation on Value1? I don't follow the rhyme and reason for this.
Jul 10 '07 #8
questionit
553 512MB
I know but i am working on already developed big project, the guys have done it this way.

You have told me to use ME.ListBoxName.AddItem() for VBA . But i get error, saying this doesn't exist

for the list box which fethces value from table/query, can we not write a sql statement with UPDATE thing to update values in the ListBox ?



Why are you doing the calculation based on row number rather than an ID of some sort?

Are you saying if the values were:
Value3
Value2
Value1

You would now do the calculation on Value1? I don't follow the rhyme and reason for this.
Jul 10 '07 #9
Rabbit
12,516 Expert Mod 8TB
To use the SQL update, it would have to change the values in the table and then you would have to requery the row source.

.AddItem() only works if your listbox is a Value List.

Why not change the code so that the calculation isn't done on the third row but on the value you want no matter where it is in the listbox.
Jul 10 '07 #10

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

Similar topics

5
by: Jeffrey Silverman | last post by:
Hi, all. I have a linked list. I need an algorithm to create a tree structure from that list. Basically, I want to turn this: $list = array( array( 'id' => 'A', 'parent_id' => null, 'value'...
13
by: querypk | last post by:
If this is the list. values = as we can see there are peaks in the list.that is 0,72,0 is a group(triangle) with peak 72.then 0, 4, 9, 2, 0, 0 with peak 9 and 0, 42, 26, 0 with...
19
by: William Wisnieski | last post by:
Hello Everyone, I have a main form with a datasheet subform that I use to query by form. After the user selects two criteria on the main form and clicks the cmdShowResults button on the main...
90
by: Christoph Zwerschke | last post by:
Ok, the answer is easy: For historical reasons - built-in sets exist only since Python 2.4. Anyway, I was thinking about whether it would be possible and desirable to change the old behavior in...
2
by: Zlatko Matić | last post by:
Hello. How to reference selected values from a multi-select list box, as a criteria in a query ? Is it possible at all? Regards, Zlatko
9
by: zacks | last post by:
I have written a serialized class that has several properties that are typed as a list of type class. When I deserialize an XML file, the list is populated just fine. But I am having trouble...
5
by: Little | last post by:
I have this program and I need to work on the test portion, which tests if a Val is in the list. It returns false no matter what could you look at the part and see what might need to be done to fix...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
4
by: phcmi | last post by:
I have a PropertyGrid question. My task is to replace a legacy dialog box presentation with a modern one. The dialog itself allows the user to set configuration settings in our application, so...
1
by: jmartmem | last post by:
Greetings, I have a nagging problem with client-side dynamic dependent list boxes that perhaps someone can help me troubleshoot. I have a form with a series of dynamic dependent list boxes....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.