Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding data

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
HOw do I create a button to find specific names in my database? In this case I want to find a name in a subform on my form. I keep getting errors around the recordset area of this. Also to create my find button I just use the toggle button on my Toolbox? The command button on the toolbox would not let me put in an event module.

[tt]
Private Sub Toggle84_Click()
Dim varName As Variant
Dim strBkMark As String

varName = InputBox("Enter data:", -"Find Name", "*sm*")
If varName = " " Then
Exit Sub
Else
varName = "'" & varName & "'"
End If

With Me.FindNameField.Recordset
strBkMark = .Bookmark
.FindFirst "Name LIKE " & varName
If .NoMatch Then
.Bookmark = strBkMark
MsgBox "Could not find a name like [" & varName & "]", _
vbCritical, "Find Error"
End If
End With

End Sub[/tt]
 
Where do you open your recordset and select the source? It would be helpful to see that code and also know which error you are receiving. Kelly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top