Search Box in header

Dogberry

Registered User.
Local time
Today, 13:57
Joined
May 9, 2017
Messages
16
Hi Folks

I hope the screenshot has uploaded for you. I have no knowledge of vba. What I am looking for is a simple way to search on two fields from the header so that i can search for ie strawberry then refine it to a specific variety ie cambridge, flamenco or marshmallow.

The record once found would then be displayed.

Thanks for the input.

Dogberry

PS Many thanks to all who helped me in the early stages of my database.
 

Attachments

  • search.png
    search.png
    70.4 KB · Views: 81
Normally search boxes are only used to search one field.
A better approach in your case would be to use cascading combo boxes where the output of the first e.g strawberry determines what appears in the second combo.

If you do a forum or google search for cascading combo boxes you should find plenty of examples
 
Thanks for the pointer to combo boxes. The examples I have looked at appear to be select from a list.

Is it possible to set up the first box for typing in the plant name myself as the Mrs has over 300 plants/varieties.

So I would type in Strawberry to the first box and the second box would show only Flamenco Cambridge and Marshmallow.

Then when I click on select it will show the database entry in my form.

Thanks again.

Dogberry
 
You can use a list but I recommend you instead use a table or query to populate each of the combos
 
Thank you for the help.

As you can see from the attached picture its working now in the form header but not showing the correct plant on the form.

Variety is unique within the database, how do I link it so that the form updates to what has been selected.

Dogberry
 

Attachments

  • headerUpdate.png
    headerUpdate.png
    73.8 KB · Views: 59
Thank you for the help.

As you can see from the attached picture its working now in the form header but not showing the correct plant on the form.

Variety is unique within the database, how do I link it so that the form updates to what has been selected.

Dogberry

Add code to the after update event of the second combo so that the form is filtered to the output of your search results. To do so, use the unique ID based on the search
 
Hi Ridders you have been an absolute diamond with this. I thought it might be a code job. I found some vba that works perfectly when you click a search button, but when I use it as an afterupdate i get "no Match" a match is present? so I have put it in the vba section in the hopes someone might be able to amend code so it work with after update.

Thanks again

Dogberry
 

Users who are viewing this thread

Back
Top Bottom