K said:
HI Dirk, THanks it worked. I have another question.
I have a main form called frmMain and in this form I have two subforms
frmRates - Sub form
frmCap - Sub form
In frmRates when the user selects the Cost Center number I would like the
frm Cap to filter this number and display the information regarding the
Cost
Center Number which are the capaabilities of it. I was thinking the Event
on
got focus apply filter to the frmCap. How can I do this?
The field in frmRates is called SUBCC and in frmCap is CCNUM
Since this question is unrelated to the original one, it would have been
better to post it as the start of a new thread. That's better for other
people who may search the forums, and may be better for you in soliciting
the advice of more people than just me. But let me see if I can answer it.
If I understand your description, you may be able to do this with no code at
all. You can make one subform use information from the other subform as one
of its Link Master Fields, so that it automatically shows the related
information. Here's one way to do that:
1. Create a text box on frmMain with these properties:
Name: txtRatesCC
Visible: No
Control Source: =[frmRates].[Form]![SUBCC]
Note 1. This text box is invisible, so you can make it any size you want,
and put it anywhere on the form.
Note 2. I'm assuming that "frmRates" is the actual name of the subform
control on frmMain, not just the name of the form object that subform
control displays. Make sure of that -- you need to use the name of the
subform control in the control source of txtRatesCC, whether or not that's
the same as the form name.
2. For the subform control frmCap, set the following properties:
Link Master Fields: txtRatesCC
Link Child Fields: CCNUM
That ought to do it, unless I've overlooked something or there's something
you haven't told me.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)