473,490 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

List Box Selection opens in datasheet view

I am trying to find out if I can have a specific record that has been
selected in a list box be opened in datasheet view. I can't seem to
find where this can happen or what I need to use to make it happen?
Does anyone have any ideas? My list box is currently tied to an option
group so that they can sort the list box in order of how they want to
search for certain records. It is a maintenance form. I want the user
to be able to select the record and perform maintenance on it and then
have it refreshed in the form once complete. Is this possible? Can
someone direct me on how to start at least being able to select the
record?

Nov 13 '05 #1
1 2952
I am one of many who feel that you are taking unnecessary chances by giving
users access to datasheet view in a developed application because their are
so many things they can inadvertently do wrong. I would suggest you create a
Form for your information, and use the WhereCondition argument of the
DoCmd.OpenForm in the AfterUpdate event of the Combo or ListBox.

However, if you feel compelled to use datasheet view, the "acFormDS"
constant in the second argument of DoCmd.OpenForm will open the form in
datasheet view (no matter what Default View you have specified for it).
Here's an example of opening the Customers table from the Northwind Traders
sample database as a datasheet (using an AutoForm created from the Customers
Table as the Form, fmrCustomers).

DoCmd.OpenForm "frmCustomers", acFormDS, , "[CustomerID] = """ &
Me!cboCustomers & """"

The datasheet will show only the single selected record. Note that the
CustomerID in the Northwind Customers Table is a Text field -- that's why
the extra quote marks.

If you want to open it with all the records shown, but located to the one of
interest, create a continuous forms view of the table of interest and in its
Open event put code like the following (this, too, is for a form showing
Northwind Customers, and note that it obtains the CustomerID, criteria, from
the OpenArgs property of the Form):
Dim rs As DAO.Recordset

Set rs = Me.RecordsetClone
rs.FindFirst "CustomerID = """ & Me.OpenArgs & """"
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing

But, in the AfterUpdate of the Combo or List Box, use this code to open it
(note if passes the CustomerID, the criteria, in the OpenArgs argument).

DoCmd.OpenForm "frmCustomersContin", acFormDS, , , , ,
Me!cboCustomersContin

Good luck with your project

Larry Linson
Microsoft Access MVP


Larry Linson
Microsoft Access MVP

"Yuki" <am********@thomson.com> wrote in message
news:ci********@odah37.prod.google.com...
I am trying to find out if I can have a specific record that has been
selected in a list box be opened in datasheet view. I can't seem to
find where this can happen or what I need to use to make it happen?
Does anyone have any ideas? My list box is currently tied to an option
group so that they can sort the list box in order of how they want to
search for certain records. It is a maintenance form. I want the user
to be able to select the record and perform maintenance on it and then
have it refreshed in the form once complete. Is this possible? Can
someone direct me on how to start at least being able to select the
record?

Nov 13 '05 #2

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

Similar topics

2
3550
by: Steve Claflin | last post by:
Is there a way to have multiple keystrokes select the first matching item in a combobox? For instance, in the Doe family members combobox, typing jo would go to Jane on the j, then John on the o...
7
6259
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
6
4867
by: Joe | last post by:
I have 2 multi-list boxes, 1 displays course categories based on a table called CATEGORIES. This table has 2 fields CATEGORY_ID, CATEGORY_NAME The other multi-list box displays courses based on...
2
2727
by: PaulDonn | last post by:
I have a subform, that is part of a booking system, that is viewed in datasheet view. On the form is a list box that should display a list of current course a student is enrolled on. The list box...
5
11545
by: chrisse_2 | last post by:
Hi, I need some help. I have created a form where there are 3 combo boxes and a text box to search through records. Based on what the user fills in, you then it a "go" button to run the query...
0
7525
by: Brian Henry | last post by:
Since no one else knew how to do this I sat here all morning experimenting with this and this is what I came up with... Its an example of how to get a list of items back from a virtual mode list...
0
3211
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
3
3828
by: Cagey | last post by:
What I'm trying for: If this selection or if click on selection (highlighted line choice/ which ever selection change) w/in query's combo dropdown list box (on Switchboard), then Open in...
2
3123
by: Alan Forsyth | last post by:
That rather long subject says it. In Access97 running on XP - I want to display a Maximized size Form01, then open a Restore size Datasheet View Form02 on top of the first Form. PopUp won't give...
0
7112
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,...
0
6974
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...
0
7183
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...
1
6852
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...
1
4878
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...
0
4573
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...
0
1389
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 ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
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...

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.