Dynamically set Master / Child Fields

  • Thread starter Thread starter Cathi
  • Start date Start date
C

Cathi

I have a form that contains an option group, the option
group has a case statement that determines which subform
is diplayed. I have one source object for all the
subforms. I want to be able to set the master field and
child field depending on which "case" is selected. Have
tried a couple of things and appartently am not getting
it right as I can't seem to get it to work. Any
help/suggestions would be greatly appreciated.

Thanks
Cathi
 
Cathi

You haven't said what you've already tried, so you may hear the same ideas
again.

You could add an AfterUpdate procedure to the option group. Generically,
you'd determine which option was chosen (If ... Then, or Select Case ...),
then modify the master and child properties of the subform by referring to
it with something like:

Me!sfrmYourSubFormName.LinkChildFields
and
...LinkMasterFields
 
Yes, tried that the very first shot and kept getting an
error on that line when I tired to run (forget exactly
what the error was now). However, finally went back to
it because to me it made no sense that it wasn't working
and sure enough it worked. This seems to happen a lot in
Access - arrrgh.

Thanks, at least I know I was right with my first try! ;-
)
 
Back
Top