Do it with VBA, not macros. It's much more powerful, and if you're
going to bother to learn, you might as well learn the better tool.
Here's a very simple bit of code that will do the trick. You can put
the same code behind every control on the subform, so the user can
double click anywhere.
Private Sub txtSomeField_DblClick(Cancel As Integer)
call DoCmd.OpenForm ("frmSomeForm", , , "Invoice_ID = " &
me!txtInvoice_ID)
End Sub
A better solution, though, would be to have one function that gets
called from each of those doubleclick events. That would look very
similar:
Private Sub OpenTheInvoice
call DoCmd.OpenForm ("frmSomeForm", , , "Invoice_ID = " &
me!txtInvoice_ID)
End Sub
Then the code behind each of the doubleclick events would look like
this
Private Sub txtSomeField_DblClick(Cancel As Integer)
call OpenTheInvoice
End Sub
There are tons of other ways to go about this, which is one of the
great (and sometimes frustrating) things about programming. Welcome to
our world. It's kind of fun.
Jeremy
--
Jeremy Wallace
Fund for the City of New York
http://metrix.fcny.org