Master & ChildLinks for subform or Filter

G

G

Hi Experts,

I have a main menu form with an unbound subform. The buttons will call a
function that will open a form for subform. That works fine but i wanted to
show only records related to field USite on the main menu. Ex: Usite =
Building1, so the records that will show on my subform are records belong to
Building1 only. Currently, everything is showing up,
building1,building2..etc. I can't assign directly a LinkMaster & LinkChild
coz what I have is unbound subform.

Here's my code for calling the form for my unbound subform.

Forms!FormMain.SubformName.Visible = True
Forms!FormMain.SubformName.SourceObject = "FormInformation"

Any help are greately appreciated.

Thanks
 
M

Maurice

You could try adding the linked master and childfields on the fly as well.
This is tricky however in a multi user environment.

Try something like:

Forms!FormMain.SubformName.linkchildfield="your link field here"
and set the reference for the mainform to
..linkmasterfield="your link field here".

When setting the subform in designtime be sure to remove the previous linked
fields by setting it to ="".
After that you can set the linked field again.

I must admit though that i worked with this once and if your db is not split
you might get some trouble in a multi user environment. So before testing
make a copy of your db first!

hth
 

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