الاخوة الافاضل عند تطبيق الكود التالي
Private Sub Command3_Click()
Dim strinput As String
strinput = InputBox("Enter Home1,Home2 ,Bussiness,Office OR Mobile Phone and Wait for search", "gaf58AddressBook")
'============================
Dim strSql As String
Dim rsSearchResults As ADODB.Recordset
'Remove single quotes from strInput, otherwise program will crash.
strinput = Replace$(strinput, "'", "")
'Build the query.
strSql = "SELCT * FROM Table1 WHERE HomePhone='" & strinput & "' OR HomePhone2='" & strinput & "' OR Mobile='" & strinput & "' OR BusnPhone='" & strinput & "' OR OfficePhone='" & strinput & "'"
'Open a recordset to hold the search results.
Set rsSearchResults = New ADODB.Recordset
rsSearchResults.Open strSql, db, adOpenStatic, adLockPessimistic 'HILIGHTED
If rsSearchResults.EOF Then
MsgBox "No records were found which match that phone number."
'Don't change rs, since no match was found we'll stay on whatever
'record was previously selected.
Else
'Set the form's current recordset to hold only the search results.
Set rs = rsSearchResults
End If
'=============================
End Subتظهر لي رسالة الخطا
ON PRESSING OK OR CANCL IN INPUT BOX MSG TELL ME Run-time error' -2147217900(80040e14)': invalid SQL statment; expected 'DELETE','INSERT','PROCEDURE','SELECT',or'UPDATE' rsSearchResults.Open strSql, db, adOpenStatic, adLockPessimistic ' HILIGHTED
مرفق البرنامج
برجاء المساعدة
![29_09_05_02_32_59_1128029579_4_13_3[_].gif](http://www.arabteam2000.com/picload/pics/29_09_05_02_32_59_1128029579_4_13_3%5B_%5D.gif)
