editing search box recordsource of asset template

cjmcneil

New member
Local time
Tomorrow, 04:53
Joined
Jul 18, 2017
Messages
5
Hi All,

As a novice using access I'm using the asset template database to create a (hopefully) simple vehicle registry for work. The current template (attached) has a search box in the 'Asset List' form header which when used displays the relevant records.

My vehicle registry has only 1 table where I have added some additional fields but I'm trying to work out the best way to edit the recordsource (I think this may be the best way to do this) for the search text box to include my additional fields in the records displayed. So for example I want to use the 'Asset List' form search box to display records when searching 'registrations' or 'location'; etc.

My database is really just used for this quick search and display function of all fields in my table. At this stage it doesn't need to do anything much more complicated than that.

If anyone can give me advice or look at my database to see how I can achieve this it would be highly appreciated because I'm a bit stuck at the moment.

Cheers,

cjmcneil
 

Attachments

Not really sure what the problem is. I typed 'car' and it generated this (I added the formatting)

Code:
(
	[Retired Date ] is null or 
	[Retired Date ] > date()
) AND (
	([Item] Like "*car*") OR 
	([Description] Like "*car*") OR 
	([Comments] Like "*car*") OR 
	([Manufacturer] Like "*car*") OR 
	([Model] Like "*car*")
)

so you just need to add the other 2 fields, no?

If you're asking if there's a better way of doing it, then, not that I'm aware.

I don't understand macros having never used them and I'm not exactly sure how you're making it work. Seems to fire when a button gets the focus and on click. Both fire so the macro is running twice.
 
Thanks for your help static.

Did you grab this code when searching 'car' from viewing the macro attached to the search text box. I'm trying to find it and view myself to see if I can add in the fields like you suggested or use the macro builder to create a new on click event procedure.

Cheers,

cjmcneil
 
It's all good I worked out how to edit the macro for the search text box to also include the other fields i wanted to be used from my table.

Cheers for the help.:D
 

Users who are viewing this thread

Back
Top Bottom