access 2000 forms

T

trish elder

could someone please tell me how when i have a datasheet
form and want to go into another form (with more info)
after i double click record in datasheet view how i can
make the same record open in the other form
 
A

Allen Browne

In the DblClick event of your control, use the WhereCondition of the
OpenForm action to open the other form to the same record. This assumes you
have a primary key value available in your form that would uniquely identify
the record.

This sort of thing:

Private Sub MyID_DblClick(Cancel As Integer)
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select a record to open."
Else
strWhere = "MyID = " & Me.MyID
DoCmd.OpenForm "MyOtherForm", WhereCondition:= strWhere
End If
End Sub
 

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