Datasheet View Record to be displayed in a Individual Form.

J

Jasmine

I have a a form that's in Datasheet View and I'm looking for a way whenever
I click a specific record on the
Datasheet view that I would want a Form to open with the relevant
information from the line I was on in datasheet view.

I know I should use the DoubleClick Event , but could not retrieve the
record no matter what I do

Could someone assist me with this?

Please Help

Any help would be appreciated.
 
K

kingston via AccessMonster.com

Use the form's OnCurrent event to run DoCmd.OpenForm or something else. Also
consider using a subform datasheet if that's available in your version of
Access.
 
J

Jana

I have a a form that's in Datasheet View and I'm looking for a way whenever
I click a specific record on the
Datasheet view that I would want a Form to open with the relevant
information from the line I was on in datasheet view.

I know I should use the DoubleClick Event , but could not retrieve the
record no matter what I do

Could someone assist me with this?

Please Help

Any help would be appreciated.

I have a text box called COMPANY on my form (A97), so I just use the
On Dbl Click event for that text box. This lets me double click the
Company name for the desired record any time I want to switch between
the two views:

Private Sub COMPANY_DblClick(Cancel As Integer)
If Me.CurrentView = 2 Then 'Form is in Datasheet view
DoCmd.RunCommand acCmdFormView
Else 'Form is in Form view
DoCmd.RunCommand acCmdDatasheetView
End If
End Sub

HTH,
Jana
 
D

Damon Heron

Why not use the subform's double-click event?

Private Sub Form_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = Me!YourID 'substitute your ID field for "YourID"
stDocName = "frmyou want to open"
DoCmd.openform stDocName, , , "formID = " & stLinkCriteria
End Sub

Damon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top