473,569 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make a Datasheet like List Box

I have a datahsheet form. It is used as a sub-form within a main
form. When moving within the datasheet sub-form the cursor goes from
one field to the next (left to right if pressing the right arrow key
and vica versa). Is it possible to make it work like a list box?
What I mean is that only rows are highlighted, not individual fields.
You can do this in VB6 with a MSFlexGrid.
Nov 13 '05 #1
2 2399
Paul wrote:
I have a datahsheet form. It is used as a sub-form within a main
form. When moving within the datasheet sub-form the cursor goes from
one field to the next (left to right if pressing the right arrow key
and vica versa). Is it possible to make it work like a list box?
What I mean is that only rows are highlighted, not individual fields.
You can do this in VB6 with a MSFlexGrid.


I suppose you can Enabled = No and set the Locked = Yes to the fields
but the one field you want to scroll on.
Nov 13 '05 #2
> I suppose you can Enabled = No and set the Locked = Yes to the fields
but the one field you want to scroll on.


That's not a bad idea. However, that is not really what I am looking
for. I am using the datasheet for display only. No update is needed
for the data. I want the user to be able to scroll through the
records and stop on the record they want to select...possib ly have a
double-click event that allows them to process a record, or have a
button to process the record selected.

I was able to do it successfully by using the following code within
the datasheet form:

Private Sub Form_Current()
On Error Resume Next
Form.SelLeft = 1
Form.SelWidth = 99
Err.Number = 0
End Sub

However, I had to add the "On Error Resume Next" and "Err.Number = 0"
because it would generate errors if the datasheet didn't have focus
(i.e.: I have multiple datasheets on my main form housed in a tab
control). Even when the errors are generated, it still does what I
want.

So, I got it to work. Would anyone know a better way?
Nov 13 '05 #3

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

Similar topics

2
3057
by: deko | last post by:
I'd like to be able to do in-cell editing of a datasheet and have other fields automatically update. I know... the easy answer is to use Excel, but I'm wondering if I can pull this off in Access since all my data is in tables. For example, I have a SubForm Datasheet with these text boxes: txtAccountNumber txtCurrentBalance...
9
20280
by: Christopher Koh | last post by:
I will make a form which will search the database (just like google interface) that will look/match for the exact name in the records of a given fieldname. Any suggestions on how to make the code?
2
2730
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 has two columns, 1: Course ID 2: Course Name - column one is the bound column. The problem I have is when the form is opened only the Course ID...
4
1593
WyvsEyeView
by: WyvsEyeView | last post by:
I have a datasheet form in which one field is a combo box that will potentially contain hundreds of records. I've read about several methods of speeding up such combo boxes or limiting their initial contents and I have used those methods on "form view" forms, but they don't lend themselves to datasheet forms. One thing, of course, is to set the...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
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...
0
8132
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7678
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3656
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...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1226
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
944
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.