Master form and subform

A

a

thank you

I have 2 forms (master form) and sub form

I'm using link child field and link master field

And I have a command button in the master form, I want use this command
button to cut the link between master form and the sub form

I put this code in this command button:

Me.Client.LinkMasterFields = ""

Me.Client.LinkChildFields = ""

Docmd.Requery "Client"

This code let the subform not display any record I don't know the reason

Any help about How can I cut the link and display all subform data

Thank you
 
D

Dirk Goldgar

a said:
thank you

I have 2 forms (master form) and sub form

I'm using link child field and link master field

And I have a command button in the master form, I want use this command
button to cut the link between master form and the sub form

I put this code in this command button:

Me.Client.LinkMasterFields = ""

Me.Client.LinkChildFields = ""

Docmd.Requery "Client"

This code let the subform not display any record I don't know the reason

Any help about How can I cut the link and display all subform data


This works fine for me:

With Me.Client
.LinkMasterFields = ""
.LinkChildFields = ""
End with

I find no need to explicitly requery. If that doesn't work for you, what is
the RecordSource of your subform, and what version of Access are you using?
 
G

GotQuestion

Thanks for your prompt response. My syntax for referencing the subform was
wrong.
 

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