Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access 2007 Form - Find Command or Search Text Box Needed

Posted on 2009-05-06
1
Medium Priority
?
738 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

604 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