Hi folks, looking for help on what I reckon should be easy, but can't seem to find an easy solution.
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...
But with this database, I'm wanting to something very similar, except the search string input box already exists on the form, call it, for example, txtSearchString to save the user from scrolling down thousands of records. I type in a string to the text box, then click a "Go" button next to it, which will then carry out a sort of "Find Next" style function and highlight the text I'm looking for.
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..
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...
Code:
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..
Code:
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
Comment