search box problem

Mascotte

Registered User.
Local time
Tomorrow, 01:09
Joined
Mar 14, 2009
Messages
21
Hi,

I am doing a contacts database, i would like to add a search text box on a form to list the contact details that i search for and be able to edit it as well but i am having problems doing so because i am new to access.

Please advise.

Many thanks.
 
Could you post a sample of what you have done so far I assume you are having trouble editing the searched for result? Perhaps because it returns a filtered locked record?

Would be easier to see what you have done so far :)
 
i have a table of all my contact details. Now i want to add a search box in my form to search for my contacts and be able to edit. I dont know how a search box is done. its just a simple database im creating here. Hope u can help.

Thanks.
 
Ok will get back to you with a sample if someone don't beat me to it ;)
 
Ok attached an example of a couple of methods I have used in the past, frmSupplier uses DoCmd.FindRecord but this is restrictive and only returns exact matches.

frmSupplier1 uses a query with "Like" used in the critera referencing an unbound text box on the form which is a bit more versatile you use the Next and Previous buttons to find any other matches and records are editable in both.

Give it a try and see what you think?

Regards John :)
 

Attachments

Last edited:
Hi John,

Thanks for the post.

frmSupplier1 is what i was looking for. Do you think you could show me how its done?
I tried everything i know but cant seem to get it to work. I am actually new in access.
 
Hi John,

Thanks for the post.

frmsupplier1 is what i was looking for.
Do you think you could show me how its done?
Hope you could help.

Thanks
 
Hi John,

Thanks a lot for the post.

frmSupplier1 is what i was looking for. Do you think you could show me how its done? Hope you could help.

Thanks.:o
 
Look at the query qrySupplier this is based on tblSupplier and in the Criteria section you will see under Supplier_Name Field:

Like "*" & [Forms]![frmSupplier1].[txtSearch].[Value] & "*"

The [txtSearch] is the name of the unbound text box on the form Supplier1 this is to compare the value of the entered text to this field.

The command button on the field just has Me.Requery behind the OnClick event procedure to requery the main form when you have entered text.

Hope that points you in the general direction regards John :)

PS. If not zip your DB and attach I will make modifications with notes to guide you and post back.
 
Hi John,

I have tried everything but cant seem to get the main form to change after i have entered text. Do you know whats my problem?

Please advise.

Thanks.
 
Have you made sure that the names in ths critera of the query match the names you have given the text box used for search and your form name because without actually seeing what you have done it is very hard to advise?

regards John
 
Hi all

I was about to post a very similar question when i came across this post - almost exacrtly what I need using the frmSupplier1 search.

The only enhancement i would like to use is that is searches after each key press.... EG..

My form is a master list of all names, i have a text box at the bottom as the search field, say for example when you enter the letter J it only disaplys records starting with J then you enter JO it list all starting with JO, then on and on so if I then entered JON it would would list all starting with JON.... you get the drift...

So it's moer or less exactly what's going on here but without the need to press SEARCH after each key press.

Thanks in advance...
 

Users who are viewing this thread

Back
Top Bottom