displaying search results in another form?

gustavson

New member
Local time
Today, 06:14
Joined
Feb 4, 2002
Messages
6
I'm using Access 97.

I have a form which loads on startup. This form only serves the purpose of linking to parts on the database. Like a switchboard. Anyways, I want to add a search for record button on this form but I want the result to display on my main form. How do I set up this button so that it searches my records and displays the results on my main form in my database?

I assume there's a little code I need to add to this:

Private Sub Command37_Click()
On Error GoTo Err_Command37_Click


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

Exit_Command37_Click:
Exit Sub

Err_Command37_Click:
MsgBox Err.Description
Resume Exit_Command37_Click

End Sub

I guess I just need to tell the code where to look and where to display the results?

Hope this is enough info
Thanx
Gustavson
 
On your Main Menu add an unbound field for the user to enter the criteria you want them to search for. Create a query that you will base your main form on and in the criteria field of the field you want to filter on place code like this:

[Forms]![MainSwitchboard]![UnboundFieldName]

Now all you have to do is open the form with a command button after the user enters the search criteria.
 

Users who are viewing this thread

Back
Top Bottom