Change master & child link programmatically

R

R. Choate

How can I change the Master and Child link fields programmatically on the fly. I need to be able to change which field is common to
the Parent form and the subform when a cbobox is entered on the parent form. The subform has a default link setting, but I need to
be able to change that if my user opens a different cbobox on the parent form. I want to put the code in the on enter property of
the various cboboxes on the parent form.

Thanks in advance !
 
S

Steve Schapel

R. Choate,

Something like this...
Me.LinkChildFields = "SomeField"
Me.LinkMasterFields = "AnotherField"

I would have expected the combobox's After Update event to be more
likely than its Enter event.
 
R

R. Choate

I'm afraid the suggestion threw an error of "method or data member not found". I think I need to reference the subform somehow
because that control has the properties I'm trying to change. The Parent form containing my combo is named frmEntersht. The subform
control is named "sbfrmEnter", and the Source object for that control is a form named frmEnter. I probably wasn't clear enough in my
first post.

--
RMC,CPA


R. Choate,

Something like this...
Me.LinkChildFields = "SomeField"
Me.LinkMasterFields = "AnotherField"

I would have expected the combobox's After Update event to be more
likely than its Enter event.
 
S

Steve Schapel

R. Choate,

Sorry, I misunderstood.

Me.sbfrmEnter.LinkChildFields = "SomeField"
Me.sbfrmEnter.LinkMasterFields = "AnotherField"
 
R

R. Choate

That worked great! Thanks!

You have been sitting at your computer a long time. Your first post on this was 7 hours ago.

--
RMC,CPA


R. Choate,

Sorry, I misunderstood.

Me.sbfrmEnter.LinkChildFields = "SomeField"
Me.sbfrmEnter.LinkMasterFields = "AnotherField"
 
S

Steve Schapel

:) It's 1:50am here. I've been to bed, woken up by my sick
daughter, and couldn't get to sleep again, so what else is there for a
self-respecting newsgroup addict to do?
 

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