Open form with filter will not open to filtered recordset

  • Thread starter May via AccessMonster.com
  • 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
 
R

Rick Brandt

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 & "'"
 

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