Hi All,
I was trying to use the query given below in VBA. But its not working properly.
Dim searchwrd As String
searchwrd = InputBox("Enter the text to be searched")
str = "SELECT * FROM tblPurchaseOrder WHERE YMEOrderRef Like '" & searchwrd & "'"
rs.Open str, cn, adOpenDynamic, adLockOptimistic
Debug.Print str
If Not rs.EOF Then
MsgBox "hi"
End If
rs.Close
I entered some data that will give outputs in the query in access. But in VBA the same search data showing as rs is closed.
I hope anyone can give me a proper guidence.
Thanks & Regards
Preethi Renjith
I was trying to use the query given below in VBA. But its not working properly.
Dim searchwrd As String
searchwrd = InputBox("Enter the text to be searched")
str = "SELECT * FROM tblPurchaseOrder WHERE YMEOrderRef Like '" & searchwrd & "'"
rs.Open str, cn, adOpenDynamic, adLockOptimistic
Debug.Print str
If Not rs.EOF Then
MsgBox "hi"
End If
rs.Close
I entered some data that will give outputs in the query in access. But in VBA the same search data showing as rs is closed.
I hope anyone can give me a proper guidence.
Thanks & Regards
Preethi Renjith