Open Subform in a New Window using a command button

  • Thread starter Thread starter LDMueller
  • Start date Start date
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
 
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
 
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).
 
Back
Top