Search Results Form

Meinthecorner

Registered User.
Local time
Today, 08:43
Joined
Nov 29, 2008
Messages
25
I have a form that contains Customer Call Details (form A) and a seperate subform that contains customer address details.

I needed a way for the staff to be able to search and list records by searching under the customers last name. I've achieved this using an Unbound text box on form A, that the staff can enter the surname, hit submit, this then loads a new form (form B) based on a query that is tied to the unbound Text box using 'like [formA]![txtSearch] &"*" as the criteria.

This works fine and lists all possible customers. Form B is a continuous form and at the end of each row is a "Show Record" button that then loads Form A showing the current record where the IDs match. Form A is therefore filtered.

The problem I have is this leaves the search results form open.

Is there a way so that when the "Show Record" button is pressed, it passes the filter request to Form A and closes itself?

Is there also a way of doing it so that it doesn't Filter the records, just goes to the required record?
 
Enter a command in your search code to close the first form

Do.Cmd CloseForm "FormName"

Make sure your second form is open before you close the first form or your search will be aborted.
 
Hi thanks for the reply.

I abandoned the whole search results form after reading a few threads here. I changed it to a unbound text box and a combo box on Form A. The combo box tied to a query which looks at the text box for the search critera. I've put an after update event on the text box to requery the combo box and it works perfectly. :)
 

Users who are viewing this thread

Back
Top Bottom