Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting record in subform

Status
Not open for further replies.

gazza110

Technical User
Apr 14, 2004
42
GB
I have a subform that has a datasheet view. I want to be able to select the record upon the mouse being over this record.


CODE
docmd.RunCommand acCmdSelectRecord

only selects the first record as this is where the record selector is. I want to move focus to which ever record the mouse is over (then once clicked it opens a new form). I have tried goto record without success and tried


CODE
me.setfocus

again to no success. Any ideas anyone ???

Thanks,
Gary.
 
Is the mouse over bit essential? Is it that you wish to open a form and go to the record selected? If so, you can just use the click or double-click event (double click is usually best). For example:
Code:
Private Sub CustomerID_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmForm", acNormal, , "CustomerID=" & Me.CustomerID
End Sub
Apologies if I have missed your point.

 
Thanks for this Remou however this is not really what I'm looking for.

I am able to open the form using a click event. The subform is in datasheet format. I the row to turn black (select the record) when the mouse is over it (so the user can tell which record it is they are selecting).

The command: docmd.RunCommand acCmdSelectRecord

only selects the first record (row) on the subform/datasheet. I need to move the focus to where the mouse is (which record it is over).

Any ideas?

Thanks,
Gary.
 
I do not think you can do this. All I can suggest is that you use the click event to highlight the record (DoCmd.RunCommand acCmdSelectRecord) and a double-click to open the form. :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top