selected row count of list box

A2k

Is there a way to get the selected row count of a list box dynamically as
the user selects rows? Delphi has an event called "OnSelectionChanged" but
Access is much more limited. I don't want the user to have to exit the list
box or click a button or anything manual in order to see the # of rows he's
selected. How can this be done?

I know about "lstCusts.ItemsSelected.Count" but not sure what event to use
it in to accomplish what I need.

Thanks,

Keith


0
Keith
10/11/2007 3:25:31 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
1516 Views

Similar Articles

[PageSpeed] 17

Never mind. I did this and it handles both mouse and keyboard selections:

Private Sub lstCusts_AfterUpdate()
    Me.txtSelRowCount = lstCusts.ItemsSelected.Count
End Sub

Private Sub lstCusts_Click()
    Me.txtSelRowCount = lstCusts.ItemsSelected.Count
End Sub

Private Sub lstCusts_KeyUp(KeyCode As Integer, Shift As Integer)
    Me.txtSelRowCount = lstCusts.ItemsSelected.Count
End Sub



"Keith G Hicks" <krh@comcast.net> wrote in message
news:OeMy5rBDIHA.4712@TK2MSFTNGP04.phx.gbl...
> A2k
>
> Is there a way to get the selected row count of a list box dynamically as
> the user selects rows? Delphi has an event called "OnSelectionChanged" but
> Access is much more limited. I don't want the user to have to exit the
list
> box or click a button or anything manual in order to see the # of rows
he's
> selected. How can this be done?
>
> I know about "lstCusts.ItemsSelected.Count" but not sure what event to use
> it in to accomplish what I need.
>
> Thanks,
>
> Keith
>
>


0
Keith
10/11/2007 3:33:10 PM
"Keith G Hicks" <krh@comcast.net> wrote in message 
news:OeMy5rBDIHA.4712@TK2MSFTNGP04.phx.gbl...
> A2k
>
> Is there a way to get the selected row count of a list box dynamically as
> the user selects rows? Delphi has an event called "OnSelectionChanged" but
> Access is much more limited. I don't want the user to have to exit the 
> list
> box or click a button or anything manual in order to see the # of rows 
> he's
> selected. How can this be done?
>
> I know about "lstCusts.ItemsSelected.Count" but not sure what event to use
> it in to accomplish what I need.

Use the listbox's OnClick event.



0
Stuart
10/11/2007 3:38:20 PM
"Keith G Hicks" <krh@comcast.net> wrote in message 
news:ugy8JwBDIHA.5752@TK2MSFTNGP02.phx.gbl...
> Never mind. I did this and it handles both mouse and keyboard selections:
>
> Private Sub lstCusts_AfterUpdate()
>    Me.txtSelRowCount = lstCusts.ItemsSelected.Count
> End Sub
>
> Private Sub lstCusts_Click()
>    Me.txtSelRowCount = lstCusts.ItemsSelected.Count
> End Sub
>
> Private Sub lstCusts_KeyUp(KeyCode As Integer, Shift As Integer)
>    Me.txtSelRowCount = lstCusts.ItemsSelected.Count
> End Sub
>
>
>
> "Keith G Hicks" <krh@comcast.net> wrote in message
> news:OeMy5rBDIHA.4712@TK2MSFTNGP04.phx.gbl...
>> A2k
>>
>> Is there a way to get the selected row count of a list box dynamically as
>> the user selects rows? Delphi has an event called "OnSelectionChanged" 
>> but
>> Access is much more limited. I don't want the user to have to exit the
> list
>> box or click a button or anything manual in order to see the # of rows
> he's
>> selected. How can this be done?
>>
>> I know about "lstCusts.ItemsSelected.Count" but not sure what event to 
>> use
>> it in to accomplish what I need.
>>
>> Thanks,
>>
>> Keith

You really only need the click event. It responds to both kbd & mouse.



0
Stuart
10/11/2007 3:57:14 PM
Reply:

Similar Artilces:

GDI is a "Top 50" Inc500 Listed Company...Are You Tired of Working Hard to Make Someone Else Rich?
Dear Friends, Are You Tired of Working Hard to Make Someone Else Rich? This Inc500 listed company is giving away money... This company is going to set me up for life and it can do the same for you. Read about how 1000's of real people worldwide who are building their own "Income for Life"=99 http://freedom.ws/helenmoonlight/show_dvd Watch the video until the end - make sure your speakers are on before you click http://www.website.ws/helenmoonlight I am confident that you will be impressed with what you see and hear. http://www.my.ws/helenmoonligh...

Query-based list w/1 Exception
I've created a query based distribtuion list which works fine yet out of the 1000 or so mailboxes it gives me I'd like to exclude 10. Is there a way? (Basically I have checked only "Users with Exchange mailbox") Make those 10 recipients members of a distribution group, and add the following to the query: (&(your current query)(!memberOf=distinguished Name of the distribution group)) Alternatively, if there's a common value of a particular attribute like location/city/department, et al, use that to exclude them. -- Bharat Suneja MVP - Exchange www.zenprise.com ...

Combo box list selection based on earlier selection by user
HI, I have a form that has a combo box 1 (Product) that reads a the Product table and has a unique id attached to each product (RO#). There is a second combo box 2 that is RO#. Now what I would like to do is when a user selects a Product in combo box 1, the system should lookup the Product selected from combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I am using both combo boxes as Unbound and in the combo box 2 I have the two columns Product and RO# - in the Criteria row of RO# I have the following: Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![x...

Run report on multi selected records.
I try to make a report for a custom entity that works like the Account Summary: let's say that it's Customer's Inquiry Summary for entity Customer's Inquiry I made the report so that I'm able to run the report on Customer's Inquiry Form. But when I select multi records in the list of Customer's Inquiry and run report, only one record is show in one page of the the report. I would like to have the selected records appear in the report with each record on each page. How can I do this? ...

Count uniq records and assign to a control
SID is the field of underline query of a form (have many duplicates). I want to count number of uniq SID and assign the result to TotalStudent control on the form. Please help. Thanks - Song In article <e90AFyUbHHA.1388@TK2MSFTNGP05.phx.gbl>, csitnnn@hotmail.com says... > SID is the field of underline query of a form (have many duplicates). I want > to count number of uniq SID and assign the result to TotalStudent control on > the form. Please help. Thanks > > - Song > > > Maybe with a saved query such as Query1: SELECT DISTINCT SID FROM UnderlyingQ...

Displaying itmes in list that have a quanity next to them
I have a spread sheet with 2 tabs. I use the 1st tab to list items and prices.. i.e. Quanity Description Price 1 Telephone A 34.95 0 telephone B 43.95 5 Telephone C 32.43 7 Telephone D 54.98 0 Telephone E 43.44 Note I have about 60 of these On Sheet 2, I want to list in a Row by Row, the items that have a quanity next to them i.e. Quanity Description Price 1 Telephone A 34.95 5 Telephone C 32.43 7 ...

move row data to columns
We had a problem with some test data and instead of test results being recorded in multiple rows 5 columns wide, all of the data was recorded in one row multiple columns wide. The data consists of 5 readings taken every second for a period of 2 hours. Each reading is in it's own cell (no cell contains more than one reading). Do you know of a way that I can move each set of readings (5 test results) into it's own 5 column wide row? i.e. currently shows in single row as: 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, 234, 234, 234, 234, 234, etc. and I need in 5 column wide rows: 0, 0, 0, ...

how do i make square bullets for a check off list.
Format - Bullets and numbering -- JoAnn Paules MVP Microsoft [Publisher] "howard" <howard@discussions.microsoft.com> wrote in message news:3CA667D1-A518-44C5-A644-EAE6EADC37F8@microsoft.com... > ...

Can't select objects in Excel 2007
I'm trying to create a form in Excel 2007, and although I can manipulate, copy & paste controls (check boxes, etc) I can't select multiple objects to align them, etc. I've checked on-line help (and have followed the instructions), and other websites, but no one seems to have indicated a problem. It is extremely cumbersome and I need a solution. Any ideas? Thanks in advance, Jim Berglund I know this is about a year too late, but it may help others who have stumbled across this page looking for similar help. On the Home tab, in the Editing group, click Find & Select....

Lot Selection not Showing when I select PO on Receiving Entry
Usually, the Lot selection screen would pop up when I select a PO at the Line Detail of the Receivings Entry, now it does not! And GP will let items post without a lot number! It seems as if a setting has changed. Any ideas anyone? Any help is appreciated. Thanks, R Are you sure the item is marked to track lots? This wiould be set item by item on the Item Maintenance Options window. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com &q...

named excel lists
I'm somewhat of a newbie, so I may not be asking this question with the correct terminology. I'd like to define a name and attach it to the range of an "excel (2003) list". If I add a new row or column to the "excel list", then the range is suitable extended. How? Try Debra Dalgleish's nice coverage of Dynamic Ranges at: http://www.contextures.com/xlNames01.html#Dynamic Look for "Create a Dynamic Range" -- Rgds Max xl 97 --- Please respond, in newsgroup xdemechanik <at>yahoo<dot>com ---- "hidden" <hidden123456@hotmail.com...

Autofilter header row
My experience has been that the first row is where the controls (down arrow) appear when autofilter is invoked. But I've now been sent a spreadsheet (just unformatted data in a large table) where the autofilter chooses the second row. I've compared the new spreadsheet with previous versions and don't see any difference in layout, etc. What can be causing this problem? Is there something "invisible" that tells Excel which is the header row for the data to be filtered? If I select row 1 and then click autofilter, the controls do appear on row 1 but otherwi...

Select contact then hangs
Hi, please help. I have a user that when she selects a contact using To: in a new email, after selecting 2, it closes outlook??. Spec is W2kSP4\office2k with all windows updates and office updates installed. Profile has been deleted and re-created, plus i have set up personal folders and moved contacts into there, and set that folder as a default, but makes no difference. Please help. ...

Nudging Text Boxes in a Chart
Has anyone found a way to "nudge" data labels in a PPT chart? I know I can move them by clicking and dragging but when I try to use the arrow keys (as I do for objects) the cursor tabs to other areas in the chart. And when clicking and dragging the labels they seem to snap to a grid and I have very limited control over them. Thanks for any insights!! -- Trisha H No one has to "find a way", there are already several standard ways to accomplish that. :o) Turn off the "Snap Objects to Grid" (in 2003 View, Grid and Guides) or in that same loca...

Auto-fill Price List and Unit of Measure? 07-02-04
Does anyone know how to automatically fill the Price List field when a customer is selected for Quote or Order with the Customer's default price list? Same question for default Unit of Measure when a product is selected? michael@engcc.com If you create the Quote/Order within the Account/Contact that has a Price List associated, then it will default it. Frank Lee Workopia, Inc. http://www.workopia.com San Francisco, CA >-----Original Message----- >Does anyone know how to automatically fill the Price List >field when a customer is selected for Quote or Order with >th...

Selecting rows from various sheets
Hi all, I have several sheets with a few columns in each. One colum in each sheet has a unique value. Most of these unique values are th same in each sheet but not all. Is there any way that I can set up new sheet that will have the unique value in column 1 and th corresponding column values frommeach sheet beside it. For example Sheet 1 aa 1 1 1 bb 2 2 2 cc 3 3 3 Sheet 2 aa 4 4 cc 5 5 Result aa 1 1 1 4 4 bb 2 2 2 cc 3 3 3 5 5 Thanks alot, Sha -- sha ----------------------------------------------------------------------- shav's Profile: http...

Check boxes 11-27-07
Hi! I have in main form two check boxes. OI would like when If Checkbox1 = Yes Then Checkbox2 = No else Checkbox2 = Yes Then Checkbox1 = No end if Thanks in advance. an Use an option group, it will take care of all that for you. "an" wrote: > Hi! > > I have in main form two check boxes. > OI would like when > > If Checkbox1 = Yes Then > Checkbox2 = No > else > Checkbox2 = Yes Then > Checkbox1 = No > end if > > Thanks in advance. > an > You can easily do that but the effect is the same as if you have a single...

numbering text boxes?
Is there a way to number text boxes in a document? I'm trying to create coupons that I can number, putting 3 to a page, so I'd need to number the text boxes rather than the pages. Mail merge... Setup a data base list with numbers. Lots of help here Mail merge http://office.microsoft.com/en-us/publisher/CH010504371033.aspx -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Lisa" <Lisa@discussions.microsoft.com> wrote in message news:5D77331E-3B4A-47B4-BC9B-50FA4E883555@microsoft.com... > Is there a way to nu...

Lost row height format?
My boss is working in a workbook with numerous sheets. He saved the file and then reopened it after his HDD was replaced. When he reopened the file, all of the row heights were off a little bit, but since this is for a large financial report, it is a big deal. Does anyone know what could cause this and have any idea how to fix it. He swears he did not change any of the settings in excel, or manually adjust any of the rows. Prior to re-opening, all rows were set at 11. Now some are 12, some 11, some 11.5, some 10.??. This happened on every sheet. Help!!! Thanks, Mac Highl...

How do I change the elements displayed in the message list
How do I change the elements displayed in the message list. For example, to list "To" or "From" edit the view - to change just one folder, click on the row of field names and choose custom. To make all folders the same see http://www.outlook-tips.net/howto/grouping.htm -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips: http://www.outlook-tips...

select text in Calendar
I'm working on a calendar in Publisher. I'm adding text into a cell by spacing down 1 point, then typing in 8 points. Doing fine until April. At that time, I can only select cells (whole days). It will not let me select the text. Help is no help. Any hints out there. Did I accidentally select something to do this? Bonnie Have you added a picture to the cell or a shape? If you have send it to the back, make the cell no fill and try again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "GoBonnieGo" <GoB...

Field list not showing up
Excel 2007...no matter what I do the field list does not show up. when I select hide the pivot table frame goes blank, when I unhide I get the basic table verbiage, but no field list. Any thoughts? Actually when I go to fullpage view I can get the field list, but in normal view cannot get the field list to appear. driving me nuts. "JeffVA" wrote: > Excel 2007...no matter what I do the field list does not show up. when I > select hide the pivot table frame goes blank, when I unhide I get the basic > table verbiage, but no field list. > > Any thoughts? ...

Apply Rule -- Workflow Process list has missing items
Hi, I was working at applying rules manually. I used to have 3 rules to choose from. Then I had 2, then 1, and now 2 again. The 3 rules exist and have been activated the entire time. The only thing I may have done is refresh (F5) the form while the rule was running. Now it is does not have the entire list of 3 rules to choose from on this item (Order). On all other orders, the list contains 3, but only 2 for this one. Anyone have ANY insight on this behaviour?? I have seen this behaviour once before. I ended up recreating the item (it was a Case, but this time it is an Order). ...

Exchange 5.5 Distribution Lists
I am running in Exchange 5.5/2000 mixed mode and I have noticed that if I change ownership of a distribution list using Exchange Admin, the permissions of that object are not automatically updated (I have to manually give the "owner" the permission needed to add members to the list). Is this some old Exchange 5.5 thing??? ...

macro to filter data based on selected data
Hi, I am looking for a macro that requests input of a reference code and then a date and then filters the data in my spreadsheet based on this criteria. I am using excel 2007. Any help with this will be greatly appreciated. You can probably record a macro while doing it manually and then clean it up and add input boxes to ask the question or input your variable in a cell and use that. If all else fails, If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the ...