Open form with filter will not open to filtered recordset

  • Thread starter Thread starter May via AccessMonster.com
  • Start date Start date
M

May via AccessMonster.com

I have a datasheet subform that I want to double click on a record in the
datasheet subform and have another form open to that filtered record.

here is my code on the subform..... there is no code on the form that I am
opening.

Private Sub Form_DblClick(CANCEL As Integer)

DoCmd.OpenForm "frmEmpl", WhereCondition:"id_code=""" & Me.id_code & '''"

End Sub

But the form opens to the first record only. How can I modify my code to
open on the record in my subform?

Thanks,
May
 
May said:
I have a datasheet subform that I want to double click on a record in
the datasheet subform and have another form open to that filtered
record.

here is my code on the subform..... there is no code on the form
that I am opening.

Private Sub Form_DblClick(CANCEL As Integer)

DoCmd.OpenForm "frmEmpl", WhereCondition:"id_code=" " " & Me.id_code &
' '' "

End Sub

But the form opens to the first record only. How can I modify my
code to open on the record in my subform?

Thanks,
May

Your quoting looks incorrect to me. Try...

DoCmd.OpenForm "frmEmpl", WhereCondition:"id_code='" & Me.id_code & "'"
 
Back
Top