Deano wrote:
I have a little search routine going whereby the user types in some text and
clicks a button on the main form.
I then see if that text exists in a record on the subform. I get a match,
grab the record id and am now trying to automatically highlight that record
in the subform to show the user they got a hit.
How can I select that record and then perhaps move the focus into a specific
textbox?
I'm trying this a number of ways and Access isn't cooperating.
thanks
Martin
I have, on most continuous form, a text box above each column that the
users can enter text, numbers, dates to search on. Uses the F3 key to
find the next one. It's gotten pretty generic for me to create such a
form. But the basic concept is to find the rec and move to it. Let's
say the continuus form's key is called ID. You search the LastName
field for Smith.
Dim rst As Recordset
set rst = Forms!MainForm!Subform.Recordsetclone
rst.findfirst "LastName = 'Smith'"
If not rst.Eof then
Forms!MainForm!Subform.Bookmark = rst.Bookmark
Else
msgbox "Not found, try again."
Endif
rst.close
set rst = Nothing