Hi Ronnie
I'm not sure whether you're saying they're both forms or whether the one
you
double-click on is a subform and whether the form name you gave in your
second post is the one you double-click on or the one that opens.
Anyway, shown below is the command to open the required form
(frm_CustomerContacts?) and the (in my example) subform you're calling
the
command from. If you're not calling from a subform, amend the code as
required.
DoCmd.OpenForm "frm_CustomerContacts", , , "[InitLastName] =" &
Forms!frm_Main!frm_Main_Subform.Form!InitLastName
However, you must have a connection between the two forms (Link Master
and
Link Child) in order for this to work.
M
Ronnie said:
Looks close, but I must be missing something in the translation. My
form
name is "frm_CustomerContacts" and my field name is "InitLastName".
--
Ronnie
:
In the DoubleClick Event select code instead of macro, and enter this
code to
open the form
Dim MyWhereCondition as String
MyWhereCondition = "[CustName field name] = '" & Me.[CustName
fieldName
in
the form] & "'"
Docmd.OpenForm "FormName",,,MyWhereCondition
--
Please respond to the group if your question been answered or not, so
other
can refer to it.
Thank you and Good luck
:
I have a form the shows a customer name and phone number. I would
like
to be
able to double click on the customer name and go to the main
customer
form
for that customer. I've tried to set up a macro to open the form
and
find
the record. It opens the form but does not find the record. Is
there
a way
I can do this?
Ronnie