Place an unbound textbox on the form for the user to type in the phone
number. Place a button on the form for the user to click to start the
search. In the Click event of the button:
Me.Recordset.FindFirst "[PhoneNumber] = '" & Me.txtPhoneNumber & "'"
If the number exists, the form will move to that record. If the number
doesn't exist, nothing will happen. If you want to let the user know, add:
If Me.Recordset.NoMatch Then
Msgbox "The number was not found!", vbOkOnly + vbInformation, "No Match"
End If
This will require using the DAO library. If you get an error, you may not
have it selected. If so, in the code editor go to Tools|References. If there
isn't a checkbox next to Microsoft DAO 3.6 Object Library, scroll down the
list of items until you find it, check it, and click Ok.
--
Wayne Morgan
MS Access MVP
"Rajesh Sharma" <sh********@airtelindia.com> wrote in message
news:9r*************@news.uswest.net...
Dear all,
I have a table with the names and address of all my dealers along with
their telephone nos.
I want to create a form, wherein I just enter the telephone no; the
query/function searches the string in the table and throws the name and
address details of that respective dealer back on to the form.
Please give me a detailed guidance as I am not an expert in Access.
Please help me with the process and teh VBA codes
my form name is form1
table name is dealer
Regards
Rajesh
*** Sent via Developersdex http://www.developersdex.com ***