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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Find Dialog

Status
Not open for further replies.

purpleski

IS-IT--Management
Aug 14, 2002
112
FR
Hi

I found the following code on tek-tips which is excellent thanks to Lightning for that but when the firts match has been found the custom box is closed and the standard find/replace dialog comes up. Is there a way of making it so that when the first match is found the custom box is closed or better still another box comes up with next, new, closed buttons which then do what they say!

Thanks.

Private Sub cmdFindName_Click()
'Search for a Specific Surname in the "TenantName" field.
On Error GoTo Err_cmdFindName_Click
Dim strLen, i As Integer
Dim strTempName, strSearchName As String

strLen = Len(strSearchName)

DoCmd.GoToControl "txtTenantName"
strSearchName = InputBox("Enter the Surname to search for.", "Look Up Surname")
DoCmd.FindRecord strSearchName, acAnywhere, , acSearchAll, , acCurrent, True
DoCmd.RunCommand acCmdFind

Exit_cmdFindName_Click:
Exit Sub

Err_cmdFindName_Click:
MsgBox Err.Description
Resume Exit_cmdFindName_Click

End Sub



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top