Solved

Open Finder with command Button

Posted on 2004-08-06
9
407 Views
Last Modified: 2006-11-17
We are trying to input data for a Real estate database where you input City and State into a form and certain processes take place.  However we are inputing hand written data from a person with awful handwriting and we need a way to search our city table to see related cities and towns.  We want a command button that when clicked will bring up the Find Menu set to that table.  Any ideas would help a lot.
0
Comment
Question by:bobbobruns12
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 15

Expert Comment

by:will_scarlet7
ID: 11736611
Something like this?:

Private Sub CmdSearch_Click()
On Error GoTo Err_CmdSearch_Click


    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_CmdSearch_Click:
    Exit Sub

Err_CmdSearch_Click:
    MsgBox Err.Description
    Resume Exit_CmdSearch_Click
   
End Sub
0
 

Author Comment

by:bobbobruns12
ID: 11736708
Private Sub FindCitycmd_Click()
On Error GoTo Err_FindCitycmd_Click


    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_FindCitycmd_Click:
    Exit Sub

Err_FindCitycmd_Click:
    MsgBox Err.Description
    Resume Exit_FindCitycmd_Click
   
End Sub

Yeah thats the code from the Find record button.  Unfortunately it doesnt do anything.  It just says "the expression you entered refers to an object that is closed or doesnt exist"
0
 
LVL 15

Expert Comment

by:will_scarlet7
ID: 11736775
Are you trying to search the Form's recordset or a different recordset that gets modified on a command from the form?
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:bobbobruns12
ID: 11736801
I'm trying to search a table that is somewhat unrelated to the form.  It is a table that we use to look up zipcodes and counties when the user enters a city and state combo.  It isnt used to contain the records for the form, simply a lookup for the form.  
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 11736864

you can use
Private Sub cmdFind_Click()
DoCmd.OpenTable "TableName", acViewNormal

End Sub

this will open the table in view mode where you can search.
0
 

Author Comment

by:bobbobruns12
ID: 11736885
That sounds like a good start, is there a command to bring up the search box once the table is opened?
0
 
LVL 8

Accepted Solution

by:
Mourdekai earned 500 total points
ID: 11737749
DoCmd.RunCommand acCmdFind

In my experience DoMenuItem's won't work if you have made your own menus.  
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 11737791

adding mourdekai's command line

Private Sub cmdFind_Click()
DoCmd.OpenTable "TableName", acViewNormal
DoCmd.RunCommand acCmdFind

End Sub


should get you going.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 11738126
bobbobruns12,
??????  should have split the points?
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

820 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