Solved

Access 2007 Form - Find Command or Search Text Box Needed

Posted on 2009-05-06
1
734 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

707 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