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!lstName s
For Each varItm In ctl.ItemsSelect ed
Debug.Print ctl.ItemData(va rItm)
Next varItm
With a datasheet:
Dim ctl As Control
Set ctl = Forms!frmMain!f rmInventory
For Each varItem In ctl.ItemData(va rItem)
Debug.Print varItem
Next
does not work
Dim frm As Form
Set frm = Forms!frmMain!f rmInventory.For m
For Each varItem in frm.?????
Debug.Print varItem
Next 8 7697
You can select contiguous rows in a datasheet.
Use the SelTop and SelHeight properties to get information about the
selected rows programmaticall y.
--
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_******** *********@newss vr25.news.prodi gy.com... 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!lstName s
For Each varItm In ctl.ItemsSelect ed
Debug.Print ctl.ItemData(va rItm)
Next varItm
With a datasheet:
Dim ctl As Control Set ctl = Forms!frmMain!f rmInventory For Each varItem In ctl.ItemData(va rItem) Debug.Print varItem Next
does not work
Dim frm As Form Set frm = Forms!frmMain!f rmInventory.For m For Each varItem in frm.????? Debug.Print varItem Next
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_******** *********@newss vr25.news.prodi gy.com... 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!lstName s
For Each varItm In ctl.ItemsSelect ed
Debug.Print ctl.ItemData(va rItm)
Next varItm
With a datasheet:
Dim ctl As Control Set ctl = Forms!frmMain!f rmInventory For Each varItem In ctl.ItemData(va rItem) Debug.Print varItem Next
does not work
Dim frm As Form Set frm = Forms!frmMain!f rmInventory.For m For Each varItem in frm.????? Debug.Print varItem Next
> You can select contiguous rows in a datasheet.
Thanks... but I'll have to admit - I'm beginning to like list boxes more...
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******** *******@newssvr 29.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...
> 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.
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....
"deko" <dj****@hotmail .com> wrote in
news:oZ******** **********@news svr27.news.prod igy.com: 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)
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******** **********@news svr27.news.prod igy.com... 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.... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 seem to work.
Only the last clicked item appears selected (highlighted) in the
display and the return from info_selection only ever contains the last
2 items, rather than all the items I have control-clicked.
It's odd, because if I set up the...
|
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 the list
box(when there is a single selection) but no luck with multiple
selections. I'm suspecting I need to write a bit of code using an
array.
Does anyone have any insight or direction on how I might add?
|
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
selections in a form and from those selections present them in a
report. For example select a selection A,B, and C out of 9 possible
choices. Then show them seperated by a comma in a field in the report.
I also want the option of only selecting...
|
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 to highlight them in the
listbox within the datagrid control.........
Thanks,
Bill...
>-----Original Message-----
|
by: Steffen Loringer |
last post by:
Hi all,
may be an easy question: How can I allow multiple selections in a
dropdownlist?
Thanks
Steffen
| |
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 a combo box and the following combo box would filter based on the initial selection. I now would like to give the opportunity to make multiple selections and the following combo box would filter based on that. How do I go about declaring this...
|
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 click to make multiple selections. Then when I
simply click one item, all previous selections are gone.
Thanks in advance.
|
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 example) the click-Shift Key keystroke
Purpose is to allow the user to select multiple different issues of a magazine with a maximum ease of use...
(Code I use is attached below)
Many thanks for your help!
|
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 the problem that when I went to select the other drop down menus, the selections i made on the multiple select one would clear. Then I had tried putting the multiple select menu last so that the selections wouldn't clear but then after clicking the...
|
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,...
|
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...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |