Solved

Access 2007 Form - Find Command or Search Text Box Needed

Posted on 2009-05-06
1
729 Views
Last Modified: 2013-11-28
I have a form in Access 2007 that uses a parameter query to display a record set.  In this case, based on the fields; YEAR and SCHOOL.  Each record set will normally display several hundred student records.  Within that record set, I need to find students by searching the name field.  I will generally have to update multiple records for a particular school, so the name field cannot be part of the forms parameter query.

The FIND command works wells using the any part of the field option, but it has two drawbacks.  First, after updating a record, the user has to click back into the NAME field to set the Look in: Otherwise, Look in: defaults to the last field with focus.   Second, the FIND dialog box covers much of the form and the user constantly has to move it out of the way.

There will also normally be multiple records with matching names, so there has to be a Next Record function to scroll through the matches.

If I could get the Find Look in: option to remain on the NAME field, even after clicking in a different field on the form; that would work.  Obviously, that is not the way the FIND dialog is intended to work.

Filtering is too slow and cumbersome.  

Summary:

I want a way to make the FIND command default and remain looking in the NAME field.  Or, a textbox search on the NAME field and the ability to Next Record through the matching subset of records.
0
Comment
Question by:Quig653
1 Comment
 
LVL 1

Accepted Solution

by:
Quig653 earned 0 total points
ID: 24318567
I solved the issue with a textbox and one command button using docmd.findrecord and another button using docmd.findnext.

I'll clean it up later and try to incorporate both into one button.
Private Sub Command122_Click()
On Error GoTo Err_Command122_Click
 
Dim SearchValue As String
 
SearchValue = Trim(Me.FindName)
If Len(SearchValue) > 0 Then
    DoCmd.GoToControl "Name"
    DoCmd.FindRecord SearchValue, acAnywhere, , acSearchAll, , acCurrent
    
End If
 
 
Exit_Command122_Click:
    Exit Sub
 
Err_Command122_Click:
    MsgBox Err.Description
    Resume Exit_Command122_Click
    
End Sub
Private Sub Command123_Click()
On Error GoTo Err_Command123_Click
 
 
    Screen.PreviousControl.SetFocus
    DoCmd.FindNext
 
Exit_Command123_Click:
    Exit Sub
 
Err_Command123_Click:
    MsgBox Err.Description
    Resume Exit_Command123_Click
    
End Sub

Open in new window

0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question