Code Examples

Find Next

acCmdFindNext

This routine repeats the last search carried out in a field. You have to have used the Find Dialog before using this routine.

'***************** Code Start *******************
'Code by Terry Wickenden

Sub cmdFindNext_Click()
  On Error Goto ErrFindNext

  Screen.PreviousControl.SetFocus
  DoCmd.RunCommand acCmdFindNext
  Exit Sub

ErrFindNext:
  Select Case Err
    Case 2046
      'Command not available
      MsgBox "Find Next is not available at this time.", vbCritical, "Not Available"
    Case Else
      MsgBox Err.Number & ":-" & vbCrLf & Err.Description
  End Select
End Sub
'****************** Code End ********************

© 1998 - 2011 Terry Wickenden TKW Design Site developed maintained and hosted by TKW Design. This site is best viewed at 1024 x 768. Optimised for Firefox.