Open Finder with command Button

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.
bobbobruns12Asked:
Who is Participating?
 
MourdekaiConnect With a Mentor Commented:
DoCmd.RunCommand acCmdFind

In my experience DoMenuItem's won't work if you have made your own menus.  
0
 
will_scarlet7Commented:
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
 
bobbobruns12Author Commented:
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
will_scarlet7Commented:
Are you trying to search the Form's recordset or a different recordset that gets modified on a command from the form?
0
 
bobbobruns12Author Commented:
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
 
Rey Obrero (Capricorn1)Commented:

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
 
bobbobruns12Author Commented:
That sounds like a good start, is there a command to bring up the search box once the table is opened?
0
 
Rey Obrero (Capricorn1)Commented:

adding mourdekai's command line

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

End Sub


should get you going.
0
 
Rey Obrero (Capricorn1)Commented:
bobbobruns12,
??????  should have split the points?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.