Open Subform in a New Window using a command button

L

LDMueller

I have a form with a subform which does exactly what I need. However, I want
to someway change the subform to a command button so when you click the
command button, it will open the subform using the same filter.

My form is frmPatent and the subform is sfRelated. The Link Child Field is
RelatedMtr and the Link Master Fields is Matter.

Can anyone assist me.

Thanks!

LDMueller
 
M

Maurice

Place a button on the form and try this in VBA:

docmd.openform "subformname", acnormal,,"RelatedMtr= '" & me.matter & "'"

replace the subformname with your own subform name

if the linked fields are numerical fields use "RelatedMtr=" & me.matter
instead of the above.

hth
 
L

LDMueller

This has worked well with one exception. When I click the button and open
the subform "sfRelated" I need the "RelatedMtr" field (Link Child) to
autocomplete and match the Matter field (Link Master).
 

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