473,386 Members | 1,758 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,386 software developers and data experts.

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 2391
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...possibly 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
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...
9
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
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...
4
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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:
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
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...

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.