|
-
Nov 6th, 2001, 05:09 PM
#3
Gee thanks,
If I knew then I wouldn't be asking.
I did do a search but I can't seem to make it work.
I found one that uses Adodc with bound fields. How would I do the same using adodb.
Here's the one that I found:
Public Sub FindStringTroubleTicket()
Dim strFind As String
Dim intFields As Integer
On Error GoTo FindError
If Trim(txtSearch) <> "" Then
strFind = Trim(txtSearch)
With frmTicket1.Adodc1.Recordset
Do Until .EOF
'For intFields = 0 To 1
If InStr(1, frmTicket1.txtFields(0).Text, strFind, _
vbTextCompare) > 0 Then
frmTicket1.txtFields(0).SelStart = _
InStr(1, frmTicket1.txtFields(0), _
strFind, vbTextCompare) - 1
frmTicket1.txtFields(0).SelLength = Len(strFind)
frmTicket1.txtFields(0).SetFocus
Exit Sub
End If
'Next
.MoveNext
DoEvents
Loop
MsgBox "Record not found"
.MoveFirst
End With
'frmFindTicket.Top
End If
Exit Sub
FindError:
MsgBox Err.Description
Err.Clear
End Sub
Private Sub cmdCancel_Click()
Unload Me
Set frmFindTicket = Nothing
End Sub
Private Sub cmdFind_Click()
If frmTicket1.Adodc1.Recordset.RecordCount > 0 Then
frmTicket1.Adodc1.Recordset.MoveFirst
Call FindStringTroubleTicket
Else
MsgBox "RecordSet is Empty"
End If
End Sub
Private Sub cmdFindNext_Click()
With frmTicket1.Adodc1.Recordset
.MoveNext
If .EOF Then
.MoveLast
MsgBox "End of File Reached!"
Else
Call FindStringTroubleTicket
End If
End With
End Sub
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
|