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
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