From: seeker on
I have a form which is in datasheet format and would like to have the record
that is found by docmd.findrecord highlited instead of just arrow to the left
of first column. How would this be done?
From: Linq Adams via AccessMonster.com on
Two questions:

How are you planning to use DoCmd.FindRecord? You realize that you cannot
have command buttons on a Datashet View form?

What exactly do you want to 'hilight?' What you have in Datasheet View is a
row of connected textboxes. There is, in essence, nothing that will 'hilight'
the row, if that's what you're talking about. If you placed code in the
Form_Current event you could have a particular field receive focus and
hilight that field every time you move to a different record.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200910/1

From: seeker on
Thank you i am sorry I should have said subform that is datasheet view. A
text box in primary form is used to develop a search on partial or full last
name of customer. The row that is found needs hilited not just the one field.
It would be as if I clicked on the row to hilite it. Thank you again.

"Linq Adams via AccessMonster.com" wrote:

> Two questions:
>
> How are you planning to use DoCmd.FindRecord? You realize that you cannot
> have command buttons on a Datashet View form?
>
> What exactly do you want to 'hilight?' What you have in Datasheet View is a
> row of connected textboxes. There is, in essence, nothing that will 'hilight'
> the row, if that's what you're talking about. If you placed code in the
> Form_Current event you could have a particular field receive focus and
> hilight that field every time you move to a different record.
>
> --
> There's ALWAYS more than one way to skin a cat!
>
> Answers/posts based on Access 2000/2003
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200910/1
>
> .
>
From: KenSheridan via AccessMonster.com on
Using the FindRecord method, the following code in the parent form's module
should find and highlight a row in the subform in a subform control named
sfcCustomers where the LastName value starts with the string entered in the
text box txtName in the parent form.

Dim frm As Form

Set frm = Me.sfcCustomers.Form

Me.sfcCustomers.SetFocus
frm.LastName.SetFocus
DoCmd.FindRecord Me.txtName, acStart
RunCommand acCmdSelectRecord

Personally I'd not have used the FindRecord method, but instead found the
record in a clone of the subform's recordset and then, if a match exists,
synchronized the bookmarks:

Dim frm As Form
Dim rst As Object

Set frm = Me.sfcCustomers.Form
Set rst = frm.Recordset.Clone

With rst
.FindFirst "Lastname Like """ & Me.txtName & "*"""
If Not .NoMatch Then
frm.Bookmark = rst.Bookmark
Me.sfcCustomers.SetFocus
RunCommand acCmdSelectRecord
End If
End With

Ken Sheridan
Stafford, England

seeker wrote:
>Thank you i am sorry I should have said subform that is datasheet view. A
>text box in primary form is used to develop a search on partial or full last
>name of customer. The row that is found needs hilited not just the one field.
> It would be as if I clicked on the row to hilite it. Thank you again.
>
>> Two questions:
>>
>[quoted text clipped - 6 lines]
>> Form_Current event you could have a particular field receive focus and
>> hilight that field every time you move to a different record.

--
Message posted via http://www.accessmonster.com

From: KenSheridan via AccessMonster.com on
A complete row can be highlighted by means of the acCmdSelectRecord constant
as the command argument of the RunCommand method.

Ken Sheridan
Stafford, England

Linq Adams wrote:
>Two questions:
>
>How are you planning to use DoCmd.FindRecord? You realize that you cannot
>have command buttons on a Datashet View form?
>
>What exactly do you want to 'hilight?' What you have in Datasheet View is a
>row of connected textboxes. There is, in essence, nothing that will 'hilight'
>the row, if that's what you're talking about. If you placed code in the
>Form_Current event you could have a particular field receive focus and
>hilight that field every time you move to a different record.
>

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200911/1