473,793 Members | 2,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

finding records

I have several read only datasheet subforms for which I would like to
incorporate a feature similar to the auto expand of a combo box i.e.
user presses a series of keys and and the record pointer jumps to the
nearest match.

I have successfully managed this with a single keypress by calling
following procedure from the forms on key press event

Function FindData(KeyPre ssed)
Dim rst As Recordset
Dim k As String
Dim frm As Form

Set frm = Forms!simpleRec ordSheet.Record Sheet.Form
k = "[" & frm.activeContr ol.ControlSourc e & "] Like '" &
Chr(KeyPressed) & "*'"
Set rst = frm.RecordsetCl one
rst.FindFirst (k)
If Not rst.NoMatch Then
frm.Bookmark = rst.Bookmark
End If
rst.Close
Set rst = Nothing
End Function

But how to trap successive keystrokes via key press event?

I am thinking along the lines of storing the keys pressed in an
invisble text control and then running the find routine if there is no
keyboard activity for about 1 second - though I am stumped on how to
control this.

I suppose the easy way out would be to pop up the find dialog box but
that isn't very seamless for the user. Any suggestions to how this
might be solved would be a great help.

Thanks

Chris
Nov 12 '05 #1
1 2168
TC
Use the Change event of the textbox where the user enters the value. That
event will fire >the instant< the user changes the textbox value. (The
BeforeUpdate event only fires when he tries to leave the textbox.) Code in
the Change event can then use Me![xxx].Text as the value to be searched for.

HTH,
TC
"Chris" <ch**********@h otmail.com> wrote in message
news:f0******** *************** ***@posting.goo gle.com...
I have several read only datasheet subforms for which I would like to
incorporate a feature similar to the auto expand of a combo box i.e.
user presses a series of keys and and the record pointer jumps to the
nearest match.

I have successfully managed this with a single keypress by calling
following procedure from the forms on key press event

Function FindData(KeyPre ssed)
Dim rst As Recordset
Dim k As String
Dim frm As Form

Set frm = Forms!simpleRec ordSheet.Record Sheet.Form
k = "[" & frm.activeContr ol.ControlSourc e & "] Like '" &
Chr(KeyPressed) & "*'"
Set rst = frm.RecordsetCl one
rst.FindFirst (k)
If Not rst.NoMatch Then
frm.Bookmark = rst.Bookmark
End If
rst.Close
Set rst = Nothing
End Function

But how to trap successive keystrokes via key press event?

I am thinking along the lines of storing the keys pressed in an
invisble text control and then running the find routine if there is no
keyboard activity for about 1 second - though I am stumped on how to
control this.

I suppose the easy way out would be to pop up the find dialog box but
that isn't very seamless for the user. Any suggestions to how this
might be solved would be a great help.

Thanks

Chris

Nov 12 '05 #2

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

Similar topics

5
6601
by: sdowney717 | last post by:
Is there a way to construct a query to select for whole words only? select id from bookdata where titles like '%Test%' gets everything with test somewhere in the field. So you could get records which have test as a subset of a larger word like 'testing' etc... What I am interested in is finding just the individual words in a stored field. Say a field has 'Test your knowledge on this one.' and you want to find
2
7132
by: Antitax | last post by:
I have a database with more than 800 adress records Some of the are similar because some letters in the street adress for example are not identical, altough they point to the same adress. Does anyone have the syntax for a query that shows similar adresses thar could be duplicates? Thank you
5
4390
by: Mike | last post by:
Hi I've written a module to find the first occurrence of a record in a query (that is my forms datasource) that matches four specified criteria. No matter what I try it doesn't seem to find records even though they are in the recordset as you can navigate to them using the forms navigation buttons. weekending, weekday, ba (business area), projected Here's the module can anyone spot where i'm going wrong? Any suggestions would be...
2
1214
by: Mark Vergara | last post by:
Hi! Is there any way of finding of what position in a particular record ? For example I have 3 records 1 Record 1.. 2 Record 2.. 3 Record 3..
2
2853
by: ElkGroveR | last post by:
Hi there! I'm using PHP to create a simple, dynamic MySQL SELECT query. The user chooses a selection from a HTML Form SELECT element's many options and submits the form via a POST action. The SELECT query is built as follows: $itemtype = stripslashes(trim($_POST));
2
28909
by: Carroll | last post by:
I'm looking for a way in SQL to find duplicate records in a single table, that are the same based on 3 columns, regardless of what is in the other columns in the duplicate records. I would like to keep both records (or it could be more than 2 as well) where duplicate records are found. Also, I am interested in selecting all columns from the duplicate records. Thanks, Carroll Rinehart
1
4012
by: rgurganus | last post by:
I'm trying to setup a way to find possible duplicate or near-duplicate records of contact people. I have a table of 50k records doing an inner join with itself, something like this: SELECT p1.fields, p2.fields FROM table AS p1 INNER JOIN table AS p2 ON p1.lastname = p2.lastname WHERE p1.id <p2.id AND (other criteria) The id and name and other criteria fields are indexed as well as they
1
1188
by: Deepmala26 | last post by:
Hi, I m doing a project in VB.NET. I've created form and database connectivity is done. I've displayed data in Datagrid through which user can sort and find records. for finding the records, one combo box is used in which column name is given. when user select the perticular column name then in the text box he should write the data which he wants to search. eg: If he select "Name" column in combo box then he writes name in...
6
2316
by: MyWaterloo | last post by:
''''''''''''''''''''''''''''''''''''''''''' ' The AfterUpdate event procedure used in ' ' the Find Customer combo box search. ' ''''''''''''''''''''''''''''''''''''''''''' 'Moves to Customer Name text box and 'finds the record of whatever name 'is selected in the combo box DoCmd.ShowAllRecords Me.OrderDate.SetFocus
9
4636
by: warrior2009 | last post by:
I have 2 lists (unlinked and unrelated), where one can be called the parent and the other the child with one to many relationship between parent-child. The child table is really big, over a million records. The link between the two, is a set of 3 fields that must be equal between the two. So when the two match, there can be a number of records in the child field, because it is related to the usage history of the parent record. So here is my...
0
9670
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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,...
1
10159
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
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...
0
9033
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, 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...
1
7538
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
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
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.