Listbox ?

Is it possible to prevent a user from selecting any item in a listbox?  I'm 
using a listbox to display the values of several cells.  I just want the user 
to be able to scroll through the list box and read what is there but not 
select anything.  is this possible?

Thanks for the help.
-- 
JT
0
Utf
4/22/2010 9:06:10 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
508 Views

Similar Articles

[PageSpeed] 2

You can set the enabled property to False, if the list box is from the 
control toolbox.  However, if the user is Excel xavvy, they can change it 
back to true.  Maybe a textbox or a label would have been a better choice.



"JT" <JT@discussions.microsoft.com> wrote in message 
news:59384919-5369-4B37-8CF3-B6CB407D49FA@microsoft.com...
> Is it possible to prevent a user from selecting any item in a listbox? 
> I'm
> using a listbox to display the values of several cells.  I just want the 
> user
> to be able to scroll through the list box and read what is there but not
> select anything.  is this possible?
>
> Thanks for the help.
> -- 
> JT 


0
JLGWhiz
4/22/2010 10:26:12 PM
Reply:

Similar Artilces:

Creating a Listbox
Hello to all! I'm creating my first aplicattion in MFC and now i need to create a listbox like this in the picture : http://www.clarionmag.com/cmag/v1/images/listbox-fig1.gif How do i create the top line with the Country, Current ..., and put the correct data in the correct column?? That's actually a List Control, in report mode. That should be pretty easy to create. Add a List Control to your dialog through the resource editor, set it to report mode, and attach a variable to it. Then in your dialogs OnInitDialog you can add columns to it, and then add items to it. Here i...

Sum values in listbox?
In one of my db's (A2003) I have a listbox that displays CurrentDate, CompanyName, CountOfInvoices, SumOfInvoices. I'm wondering If there is a way to display a sum of all the items in, for example, Column(2) and (3) of the list box to get a grand total. Right now I'm using a separate list box to display the values I want, which works fine, so mostly I'm just curious. I couldn't figure out a way to do it, but maybe I'm just being a meat head and overlooking something. Any ideas? TIA (is meat head one word or two?) I have not tried this, but I had an idea that maybe...

Refresh listbox from field being edited
Hi. I have a form containg several fields and also containing a list box. I want the list box to respond while entering data (or modifying) one of the fields. I suppose I must trigger some event as keystrokes are being pressed. The problem is that while editing the field it is not yet stored in the table, so I can't retrieve it's date in order to set and apply a filter to thre listbox. How do I get the content of the field before it has been stored? And what about the same in a new record? Thanks H. Martins strictly speaking, forms don't "contain" fields in the se...

ListBox (maybe?) ... If so, how?
Excel 2000 ... Earlier today I saw a spread sheet that had what appeared to be a Filter Switch in a Cell. When cell with switch selected ... switch listed 2 values to choose from (Y or N) ... In addition, as different cells (requiring same Y or N value) were selected the switch moved to selected cell. Above said ... how is this all accomplished as I wish to replicate this capability on another spread sheet? Thanks ... Kha Ken, What you describe sounds like Data Validation. Check out "Designate valid cell entries" in Excel Help. David "Ken" <anonymous@discu...

Data validation
Hi I have a need for data validation in which list entries are reduce when used anywhere in a pair of rows. However, each entry in the list should remain useable in the following pair of rows until used there, etc, etc. Example List Cat Cow Dog Bat R1 Cat Cow R2 Dog Bat R3 Cat Dog R4 Cow R5 R6 Cat R7 R8 Cat would only be available in rows 7&8 Cat, Cow, Dog, Bat would not be available in Rows 1 &2 Bat would be available in rows 3-8 Cow, Dog, Bat would be available in rows 5&6 All would be available in rows 7&8 Is someone able...

ListBox Coding Problem: Too few parameters. Expected 1.
I am trying to append multiple selected values from a listbox to a table. Property set to Multi Select (extended). Access 2007 Form: Main ListBox Control: List3 Test values: One, Two, Three . . . Destination Table: Selections Destination Field: Selected Control: Command Button. Syntax: ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Private Sub Command5_Click() On Error GoTo Err_Command5_Click Dim strSQL As String strSQL = "INSERT INTO selections ( selected ) VALUES (" & Me! List3.Column(1) & ");" CurrentDb.Execute strSQL, dbFailOnErro...

Customizing the way ListBox Works
I need to make ListBox work a little differently than is typically does. I need to add a keyboard interface for the <Insert> and <Delete> keys. I want the <Insert> key to add a new item, and I want the <Delete> key to delete the currently highlighted item. Does anyone know how to do this? >I need to make ListBox work a little differently than is typically does. I need >to add a keyboard interface for the <Insert> and <Delete> keys. I want the ><Insert> key to add a new item, and I want the <Delete> key to delete the >current...

Re Post Please help: Listboxes question
Hi all, =A0I got two listboxes on a spreadsheet and in those listboxes I got data like (see below) Listbox1 =A0 =A0 Listbox2 XX =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0AA VV =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0XX AA =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SS etc=85=85=85.. I need macro on a button which should match listbox1 items with listbox2 items and then show both listbox items one by one on a messagebox , but keeping in mind that matched items should be shown only one time in messabebox Please can any frined help me on this. I was able to show matched items once on a messagbox with below ...

Removing Items from Listbox
I have a listbox on a form and I want the user to be able to select the items to be removed from the list. But when I use the RemoveItem method on the first selected row, all the other items in the list become UNselected and therefore don't get removed. Can anyone help? Thanks in advance, -- Glenn By the way, I tried two different approaches with the same result. #1 Dim lb As ListBox Dim varItem As Variant For Each varItem In lb.ItemsSelected lb.RemoveItem Index:=varItem Next varItem #2 dim i as Integer dim intIndex as Integer dim lb as ListB...

Listbox Problem
I have a listbox which is populated with data from a worksheet (column count = 5) As the 6th column is a descriptive text field, I would like to hold the data of the 6th column in another listbox on the same userform. When the user clicks on the rows in the first listbox, I would like the 6th column text field to show in the 2nd listbox. Can anyone help me understand how I can make this happen. Thanks. Some clarification needed. When you say > When the user clicks on the rows in the first listbox, I would like the 6th column text field to show in the 2nd listbox...

How Do I Get Data Out of A ListBox?
I'm using a built in userform listbox with multiselect. I named it lbx1 but I can't access it from the VB Editor. I tried things like lbx1.value, lbx1.text but lbx1 doesn't seem to exist in VB editor. I'm sure it's a simple mistake. Someone please help me. ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ please ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages dir...

Multiselect Listbox for Creating Pivotcharts
Running Acess 03 in Win XP sp2. I have a form containing a listbox with multiselect option. The idea is to allow the user to select from the list all the items for which they want to print data in chart format. I have a report and want create subreports within (number of subreports equal to number of items selected in listbox). Each subreport is a pivotchart for one item selected. The problem is that the pivotcharts created contain no data when multiselect is on. I can turn off multiselect and create one subreport/chart with data. I can loop through the selected items, trap the data fro...

Listbox updating problem
I have a listbox that I want to update before calling a function that querys for bluetooth devices, but it seems like the function is being activated first because the listbox does not update until after the bluetooth function ends. Any ideas on how to get the listbox to update first. Z.K. code: m_List.ResetContent(); m_List.AddString("Querying for Bluetooth Devices -- Please Wait!!"); BTUtil.GetBluetoothInfo(Messages); >I have a listbox that I want to update before calling a function that querys >for bluetooth devices, but it seems like the function is being acti...

OLE objects in a listbox
I have several Word documents I'd like to link into my database application. I've created a table containing three fields, an autonumber record key, the OLE linked Word document, and a text description of what the document is. What I'd like to do is display these records in a listbox control on a form and be able to open any of these documents in Word if a user double-clicks one of them. Is this possible> Thanks. ...

RowSource for my ListBox
Below is the RowSource I would like to use for the ListBox on my UserForm. Can this be done without actually opening the source document (EmployeeList.xlsm)? '[EmployeeList.xlsm]Employee_List'!$A$2:$Z$300 It might be, but it would have to include the path. What can be done for sure is data in cells from a closed workbook can be placed in an open workbook, just with formulas like: ='C:\Documents and Settings\FredBloggs\My Documents\[Boook1.xls]Data'!$C$3 Now all you need to do is put that local cell range inot your rowsource property - perhaps even making i...

Excel 2000
I have created an attendance worksheet that details names as column headers and dates as row headers. I want to place a Combo Box in the intersecting cells that pulls from an abbreviations listing on another worksheet. I also must be able to sum the selected abbreviations or run a pivot table. I would rather do this all in Access, but my supervisor won't go for it. I used the following code and the drop-down worked for a minute, but now it just shows the chosen abbreviation. Private Sub ComboBox1_Click() Forms.ComboBox1.List = Array("A", "D", "E", &q...

Cascading ComboBoxes or Listboxes
I want to have a comboBox that displays a list of items when an item in the box is selected. ex Select Country ex USA Returns list of States Select State Returns list of cities Select City Returns list of ZIpcodes Any help would be appreciated. JJ, I have a workbook with 2 comboboxes that I can send you if you mail me direct. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "JJ" <anonymous@discussions.microsoft.com> wrote in message news:2bb301c3e1d7$33e9bb80$a101280a@phx.gbl... > ...

filtering contents of listbox when form opens
I have a form with a listbox. The form is opened by a call from another form. I would like to filter the contents of the list box with either openargs (or something similar). I know how to pass the value with openargs but not sure how to apply the value to filter listbox contents. Any suggestions would be appreciated. Thanks BRC Assign the openargs value to a variable, then use the variable in a sql string to make it the listbox's rowsource. For example, (pseudo code) mystr= me.openargs strsql="Select yourfields from table where field =mystr" me.listbox.rowsource= strsql ...

How do I use an Intellimouse to scroll listbox enteries in ExceL?
I have a list box with 105 alphabetized entries in it. I have seen dropdown listboxes that scroll when a mouse wheel button turned. It is a very convenient way to scroll through a dropdown list box. I have been unable to find an event, method or property that sets this action. I use vb.net to load the list box so it would be no problem is this is an action that needs to be set in code. ...

Want to avoid the possibilty to edit field in listbox
I fill my listbox with code example found on the internet written by Zameer Abdulla, LVLoadData.mdb. I'm not good at programming, only good at copying code :-). When I click twice on the same row in the listbox it becomes possible to edit the first column field. How can I avoid this. Appreciate any tips. Code below: Public Sub FillEmployees() On Error GoTo ErrorHandler 'set variables Dim rs As DAO.Recordset Dim db As Database Dim lstItem As ListItem Dim strSQL As String Set db = CurrentDb() strSQL = "SELECT * FROM Employees w...

Listbox Rowsource 08-02-07
I want to use a table as a listbox rowsource. But here is the catch. I want to add the record "ALL" to the listbox without adding "ALL" as a record in the table. Thanks DS DS <bootybox@optonline.net> wrote in news:DSqsi.43$ck6.18@newsfe12.lga: > I want to use a table as a listbox rowsource. > But here is the catch. I want to add the record "ALL" to the > listbox without adding "ALL" as a record in the table. > > Thanks > DS > Create a union query. SELECT "<< ALL >>" AS field1 from mytable UNION ...

ListBox Showing Scroll if 1 item
I have a ListBox that I fill with data from my database. I then set the number of rows attribute to the count so the box is only as large as the number of fields. lbDisplay.Rows = lbDisplay.Items.Count; This works fine. The problem is if the list has 1 item, it shows a dropdown arrow and when you press it, it shows only the one item. If there are 2 or more there is no dropdown arrow. How can I get rid of the dropdown arrow for one entry??? Why does it even show? Thanks, Tom you can't, because it sets the of the number of visible options. 1 = dropdown...

ListBox MultiSelection Problem
Hello, I am building a form which will play with all selected lines in ListBox. I have ListBox filled like that: Option1 Option2 Option3 and I select by mouse Option1 and Option2. The problem is as follows: How to get these selected elements (I mean strings like 'Option1', 'Option3', not indexes). My code: For i = 0 To MyList.ListCount - 1 If MyList.Selected(i) Then MyString = MyString & MyList.??? // what to put here??? cause ItemData return index, not string value End If Next Regards, Jan MyString = MyString & MyList.column...

Help! Unbound controls cause listbox to requery??
Have not seen this before, in 10 years of Access use. Running A2003 on XP Pro system. I've got a subform on one of my forms that contains a listbox and several other controls. The other controls (a combo and a text box) are unbound, and are filled in based on the selection in the listbox and a value on the main form. I just modified the subform, so that I now have an option group which allows the user to view the listbox filtered or unfiltered. The user selects an option from the group and the listboxs RowSource is changed to the appropriate query. What is supposed to happen i...

Sort the contents in a Listbox
I have a CDialog where the user can type in numerical values in an Editbox and which is then added to a Listbox. My question is how I sort the contents as soon as a new value has been added? Hi. Check the "sort" option for the listbox in the dialog resource editor. - Parhar "Urban Olars" <anonymous@discussions.microsoft.com> wrote in message news:8FD6A3C2-D59D-4486-8ABF-47E5B6BAC262@microsoft.com... > I have a CDialog where the user can type in numerical values in an Editbox and which is then added to a Listbox. My question is how I sort the contents as soon a...