Re: A2K - how to select a record, programatically on a continuous subform
- From: Salad <oil@xxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 10:58:11 -0700
Deano wrote:
I have a little search routine going whereby the user types in some text andI 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.
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
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
.
- References:
- Prev by Date: Re: Trying to understand the example code in A97 For Each HELP
- Next by Date: strangest hanging problem with re-attaching functions...
- Previous by thread: Re: A2K - how to select a record, programatically on a continuous subform
- Next by thread: Advice needed for a growing Access 2000 project
- Index(es):