473,399 Members | 3,302 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,399 software developers and data experts.

Do datasheets support multiple selections?

How do I get the items selected from a datasheet? Does a datasheet support
multiple selections?

I know a ListBox has a "Selected" property that can be used when the
MultiSelect property is set - but is there a way to get the same
functionality with a datasheet?

If not, I'm throwing all my datasheets in the junk..... why bother with
datasheets? get all the same functionality with a listbox?

For example, with a ListBox, it might look something like this;

Dim varItem As Variant

Dim ctl As Control

Set ctl = frmMain!lstNames

For Each varItm In ctl.ItemsSelected

Debug.Print ctl.ItemData(varItm)

Next varItm

With a datasheet:

Dim ctl As Control
Set ctl = Forms!frmMain!frmInventory
For Each varItem In ctl.ItemData(varItem)
Debug.Print varItem
Next

does not work
Dim frm As Form
Set frm = Forms!frmMain!frmInventory.Form
For Each varItem in frm.?????
Debug.Print varItem
Next
Nov 12 '05 #1
8 7660
You can select contiguous rows in a datasheet.

Use the SelTop and SelHeight properties to get information about the
selected rows programmatically.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"deko" <dj****@hotmail.com> wrote in message
news:G_*****************@newssvr25.news.prodigy.co m...
How do I get the items selected from a datasheet? Does a datasheet support multiple selections?

I know a ListBox has a "Selected" property that can be used when the
MultiSelect property is set - but is there a way to get the same
functionality with a datasheet?

If not, I'm throwing all my datasheets in the junk..... why bother with
datasheets? get all the same functionality with a listbox?

For example, with a ListBox, it might look something like this;

Dim varItem As Variant

Dim ctl As Control

Set ctl = frmMain!lstNames

For Each varItm In ctl.ItemsSelected

Debug.Print ctl.ItemData(varItm)

Next varItm

With a datasheet:

Dim ctl As Control
Set ctl = Forms!frmMain!frmInventory
For Each varItem In ctl.ItemData(varItem)
Debug.Print varItem
Next

does not work
Dim frm As Form
Set frm = Forms!frmMain!frmInventory.Form
For Each varItem in frm.?????
Debug.Print varItem
Next

Nov 12 '05 #2
You can access the rowindex by checking the SelTop and SelHeight properties
of the form to determine the starting row number, and the number of rows
selected.

Mike Storr
www.veraccess.com
"deko" <dj****@hotmail.com> wrote in message
news:G_*****************@newssvr25.news.prodigy.co m...
How do I get the items selected from a datasheet? Does a datasheet support multiple selections?

I know a ListBox has a "Selected" property that can be used when the
MultiSelect property is set - but is there a way to get the same
functionality with a datasheet?

If not, I'm throwing all my datasheets in the junk..... why bother with
datasheets? get all the same functionality with a listbox?

For example, with a ListBox, it might look something like this;

Dim varItem As Variant

Dim ctl As Control

Set ctl = frmMain!lstNames

For Each varItm In ctl.ItemsSelected

Debug.Print ctl.ItemData(varItm)

Next varItm

With a datasheet:

Dim ctl As Control
Set ctl = Forms!frmMain!frmInventory
For Each varItem In ctl.ItemData(varItem)
Debug.Print varItem
Next

does not work
Dim frm As Form
Set frm = Forms!frmMain!frmInventory.Form
For Each varItem in frm.?????
Debug.Print varItem
Next

Nov 12 '05 #3
> You can select contiguous rows in a datasheet.

Thanks... but I'll have to admit - I'm beginning to like list boxes more...
Nov 12 '05 #4
By all means use a list box if you only need to display a few rows (not 10s
of thousands), and you do not need to edit the columns.

They use fewer resources than subforms do.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"deko" <dj****@hotmail.com> wrote in message
news:jR***************@newssvr29.news.prodigy.com. ..
You can select contiguous rows in a datasheet.


Thanks... but I'll have to admit - I'm beginning to like list boxes

more...
Nov 12 '05 #5
> By all means use a list box if you only need to display a few rows (not
10s
of thousands), and you do not need to edit the columns


Yes, I suppose that is one big advantage of a datasheet - in-cell editing;
also, filtering. Is there a best-practices limit of how may records should
be retreived with a listbox? several hundred? one thousand? By the way, I
think the standard DataGrid in VB does support multiple selection, unlike
the Access datasheet.

Nov 12 '05 #6
While I have the opportunity to rant about the limitations of datasheets,
let's not forget how difficult it is to work with column widths - for
example, let's say I have a subform datasheet that I want to keep a certian
size (height and width) on the main form - a vertical scrollbar appears as
the number of records exceeds the available height. The problem is that
this results in the unwelcome appearance of a horizontal scrollbar (even if
the scrollbars property is set to vertical only) if the vertical scrollbar
overlaps any text (in any of the existing rows) when it appears. Column
widths are also a pain to set programatically.

I feel better now....
Nov 12 '05 #7
"deko" <dj****@hotmail.com> wrote in
news:oZ******************@newssvr27.news.prodigy.c om:
Yes, I suppose that is one big advantage of a datasheet - in-cell
editing; also, filtering.


I never knew that! Wow!

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #8
Deko, have you tried Continuous Form view instead of Datasheet?

Users cannot get stuck hiding columns etc.
Form header and footer sections are displayed, and can have command buttons.

Glad you feel better after the rant. :-)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"deko" <dj****@hotmail.com> wrote in message
news:T9******************@newssvr27.news.prodigy.c om...
While I have the opportunity to rant about the limitations of datasheets,
let's not forget how difficult it is to work with column widths - for
example, let's say I have a subform datasheet that I want to keep a certian size (height and width) on the main form - a vertical scrollbar appears as
the number of records exceeds the available height. The problem is that
this results in the unwelcome appearance of a horizontal scrollbar (even if the scrollbars property is set to vertical only) if the vertical scrollbar
overlaps any text (in any of the existing rows) when it appears. Column
widths are also a pain to set programatically.

I feel better now....

Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: theoryboy | last post by:
I'm trying to implement multiple selection functionality in a Tix Hlist using a control-click. I've bound control-click to a function that uses selection_set to add to the selection, but it doesn't...
1
by: jeffgeorge | last post by:
Trying to create multiple acct reports based on the selection in a list box. I've set the list box for multiple selections, and in the report data source, I have a SQL statement which is reading...
2
by: Craig B. | last post by:
I am relativly new to access 2000 and am having some trouble with a report. I am not sure what I want to do is something I can do in access. I want to be able to choose from a combo box multiple...
0
by: bill yeager | last post by:
Duray, it helps in regards to knowing how to get the items that were selected in the lisbox, but I'm going in reverse --- after I get the items from the db that were selected, I'd like to be able...
2
by: Steffen Loringer | last post by:
Hi all, may be an easy question: How can I allow multiple selections in a dropdownlist? Thanks Steffen
4
by: tbayse | last post by:
Hello, I have a question about making multiple selection queries in Access. I am running windows XP and Access 2003. Up until this point I had a form where a user would make single selections from...
18
by: =?Utf-8?B?TGkgV2VuZw==?= | last post by:
Hi, Is there a way for TreeView to have multiple selections? But I am not talking about its checked boxes. I want a way similar to ListView with MultiSelect = True. So I can use or key and...
0
by: Germaris | last post by:
Hi there! Is it possible to make multiple selections in a ComboBox ? i.e. make n consecutive selections and store them in an array or make n selections in the open list of the CB by using (for...
6
by: phpnewbie26 | last post by:
My current form has one multiple select drop down menu as well as few other drop down menus that are single select. Originally I had it so that the multiple select menu was first, but this created...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.