473,661 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listbox - Help needed

6 New Member
I have a listbox with style property set to 1-Checked.
I populate the listbox with records in a recordset.
Then I select some of the items in the listbox.
Now what I want is- I want to be able to display the listbox with the selectd items having their checkboxes ticked every time the listbox is loaded.
Help please..
Apr 6 '07 #1
1 1287
Killer42
8,435 Recognized Expert Expert
I have a listbox with style property set to 1-Checked.
I populate the listbox with records in a recordset.
Then I select some of the items in the listbox.
Now what I want is- I want to be able to display the listbox with the selectd items having their checkboxes ticked every time the listbox is loaded.
Help please..
Your code just needs to set the .Selected property for the items you're interested in. For example, to check the fourth item, you would say "List1.Selected( 3) = True". (The list starts at 0, which is why the fourth item is number 3 - stupid, but there you go).
Apr 6 '07 #2

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

Similar topics

2
3671
by: Simon P | last post by:
Hello group, I'm in desperate need of help. Here goes : I have the following tables : CONTACTS (ContactID, FirstName, LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and SHOWDETAILS (links the previous tables together so not to have a many-to-many relationship -- has the ContactID and ShowID fields). I have a main form with a couple of listboxes which are used for querying the CONTACTS table. The results populate bound fields...
3
2426
by: RC | last post by:
I have a form where the user enters the Model info. The user picks the Model from either a combobox or listbox which both are filled from the Models table. If the Model type isn't in the boxes, then the user can click a button and add a new Model to the Models table. When the user clicks the "Add new Model" button, a pop-up Form opens the user types in the new Model name into a text box and a new record is added to the Models table and...
6
7552
by: Deano | last post by:
I needed to have a listbox populated by locations which are stored in tblLocations. However I wanted an "All locations" entry to be at the top of the listbox. This is not in the tblLocations. The resulting list will be used to provide a query parameter and the user can choose all locations (the default) or a single, specific location. In the open event of the form containing the listbox I wrote the following code to achieve this. Could...
6
2872
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
6
9953
by: Mark | last post by:
Hello. I have a listbox whose rowsource is set to a saved query (call it "qry_customer_list.") When I add customers to my database, I call the listbox Requery method so that the listbox will display the customers that I added. Unfortunately, the listbox display does not change. If I close the form and reload it, then the listbox will show the new customers. Any suggestions on how to fix this?
4
2790
by: Jeff | last post by:
....still new at this. ...hopefully a simple question Is there some practical way of altering the function of a keypress in Visual Web.net 2005 using VB without causing a postback on each keypress? For example: A have a listbox with a number of selections. The up and down keyboard keys change the indicated listbox selection and by default the <tabkey takes the focus away from the listbox and onto a button that will submit the selection. I'm...
3
1485
by: walanta | last post by:
Hi, I have a ListBox that bind to a sql source with managed code? I know how to print ListBox1.SelectedItem and ListBox1.SelectedValue. to print two fields from the following select statement. But how can I print other fields in my select statement? I guess it should be ListBox1.something...?? Suppose my select statement is like :
4
9380
by: Dave | last post by:
I recently found out that the RequiredFieldValidator works differently for a ListBox than I needed; it checks to see if a row is selected, rather than checking to see if the listbox is empty. I tried using a CustomValidator but it does not seem to be firing (I have e.false in the validation function but still no intervention). Does the CustomValidator also require that a row is selected? Can I use validators for this requirement or do I...
3
1996
by: Angel Blue01 | last post by:
I have a form with a binding navigator that draws from a database via drag-and-drop-created controls. I'm filling a listbox with the results of a query. The listbox contains data related to the record that the user is viewing but cannot be databound because other events and user input are needed when the user selects an item from the listbox. Each time the user clicks the binding navigator to move to the next record I have this: <code>
20
5217
by: exipnakias | last post by:
Hello Guys. In a form I created a listbox which looks up the values of a table. I want: 1) ..to create a query where a parameter will be needed in order to be loaded. But I do not want to write the parameter, I want to select a row from the listbox and after clicking in a button, the query to automatically take the current value of listbox as the needed parameter and then to load the query. (The Inputbox for "Enter Parameter" will...
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8754
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7362
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2760
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.