I've tried searching loads of different solutions, but none seem to be for what I'm trying to do, a simple search box.
Using Access 97, I've created a form - frmTests - which shows, in Form view as continous forms, all records from a table relating to items being tested.
In previous databases, I would have just placed a command button with simply...
Expand|Select|Wrap|Line Numbers
- Private Sub cmdGoFindText_Click()
- Screen.PreviousControl.SetFocus
- DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
- End Sub
In my head, it seems a very simple task, which shouldn't have much code to it. I know I could just use the DoMenuItem feature instead, but it's not what the user wants.
Currently, my code looks like this, and appears to do nothing, no failure, no highlight..
Expand|Select|Wrap|Line Numbers
- Private Sub cmdGoFindText_Click()
- If IsNull(Me.txtTextToFind) = True Then
- MsgBox ("No search term entered!")
- Me.txtTextToFind.SetFocus
- Else
- strWhere = Me.txtTextToFind
- DoCmd.FindRecord strWhere, acEntire, True, acSearchAll, True, acAll, True
- End If
- End Sub