Double Click of Subform

  • Thread starter Thread starter Ricky Conard via AccessMonster.com
  • Start date Start date
R

Ricky Conard via AccessMonster.com

Hi,

I have a main form with a subform on it. The subform (datasheet view)
lists all the records for a particular vendor. When I double click on a
row, I'd like the detail form for that record to popup with records for
that row that I clicked.

Does anyone have the code to do this?

I have the form created and I have the DoCmd to open the form, but it's not
populating with records for that row in the subform.

Thanks for your help!!
Ricky
 
Ricky,
There has to be some value on that subform record that is unique to that
record. A key field.
Use the value of that key field to open a form... and using the Where
argument of the OpenForm function to filter out all records but the
corresponding one.
example...
DoCmd.OpenForm "frmYourForm",,, "CustID =
Forms!frmMain!frmSubform.Form!CustID"
hth
Al Camp
 
Hi
I tried the code below but received a compile error.

Private Sub Form_DblClick(Cancel As Integer)

DoCmd.OpenForm "frmEdit2", , , "SSN ="
Forms!frmEdit!frmsSortListSubform.Form!SSN"

End Sub
 
Looks like you added a " mark after the = sign. Use my code exactly, and
all on one line. Emails tend to "wrap" code.

DoCmd.OpenForm "frmYourForm",,, "CustID =
Forms!frmMain!frmSubform.Form!CustID"

Al Camp
 
Back
Top