|
-
Apr 11th, 2001, 09:28 PM
#1
Thread Starter
PowerPoster
Could someone tell me why this works only sometimes?
It finds results only every now and then when i know there in there. Why?
code:
Public Sub SCHADDEE()
' same as date but for addressee
On Error Resume Next
Dim res4 As String
Dim res5 As String
Dim res6 As String
Dim strInput As String
Set rs = db.OpenRecordset("SELECT * FROM mail")
namequery = InputBox("Enter A Name To Search For", "Name Query")
strInput = namequery
If StrPtr(strInput) = 0 Then
MsgBox "Canceled By User Request", vbInformation, "Name Query"
Else
rs.MoveFirst
Do Until rs.EOF
If rs.Fields("Addressee") Like "*" & LCase(namequery) & "*" Then
res4 = rs.Fields("Addressee")
res5 = rs.Fields("Date")
res6 = rs.Fields("Description")
MsgBox res4, vbInformation, "Addressee"
MsgBox res5, vbInformation, "Date"
MsgBox res6, vbInformation, "Description"
rs.MoveNext
Else
rs.MoveNext
End If
Loop
End If
End Sub
-
Apr 11th, 2001, 09:52 PM
#2
Take the "On Error Resume Next" part out, and see if there are acutally any errors, and if there are, fix them.
-
Apr 11th, 2001, 10:40 PM
#3
Thread Starter
PowerPoster
No errors appear!
AAAAAAAHHHHHHHHHHHHH!!!
-
Apr 12th, 2001, 02:07 AM
#4
Well ...
Try putting single quotes around the LIKE string:
Code:
If rs.Fields("Addressee") LIKE "'*" & LCase(Whatever) & "*'" Then
'
-
Apr 12th, 2001, 02:16 AM
#5
Thread Starter
PowerPoster
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|