search for a recourd by typing in a form textboxes

s_samira_21

Registered User.
Local time
Today, 05:04
Joined
Jun 8, 2011
Messages
52
hi
I have a form named form_1 that have 4 text boxes (firstname, lastname, phonenum, address)
and I have another form named form_2
now I want that when I type a word or even a character in firstname and click on find button, form_2 opens and shows all persons that their firstname is or contains the word that I entered in form_1
and it should do this for any text boxes.

please help me
 
Hi..


Add a textbox (textboxname) and a button on your form (form_1)..

Put this code in the button..:

docmd.openform "form_2", , , _
"cstr([firstname]&[lastname]&[phonenum]&[address]) like '*' & '" & me!textboxname & "' & '*' "



.
 
oook thank you very much
according to your help I used this code:

DoCmd.OpenForm "user_info_edit", , , _
"cstr([name]&[semat]&[tell]&[address]) like '*' & '" & (Me!name & Me!semat & Me!tell & Me!address) & "' & '*' "

it works but there is a problem

when I type "ja" in name textbox the "user_info_edit" form finds "jack"
but when I type "ck" it dose not find anything
 

Users who are viewing this thread

Back
Top Bottom