E
Ed880
Problem Summary: I need to get a combo box on one subform (page) of a tab
control to be populated with the new values entered on a previous subform
(page) without having to use a Refresh command button on the combo box's
subform.
Details about my application and problem:
I'm developing a simple fund-raising application in Access 2000 (9.0). The
"core" of this application is a master form (frmConstituentRecords) that
contains a tab control with multiple pages. Each page contains one or more
subforms that are used to enter, edit, and review records for an individual.
The master form contains a unique autonumber field (ConsID), that provides
the Child/Master link for each tabbed subform and allows synchronization of
records via ConsID.
Each subform's records are tied to a different table (with ConsID as the
foreign key.)
Each tabbed subform contains records that relate to some aspect of the
individual, like bio info, addresses, phones, gifts, etc. The tabbed subforms
are in a specific order that relates to the way new data is entered for a new
individual. In some cases, a subform depends on the records from a previous
tabbed subform to populate one or more of its fields. For example, the phones
tab uses data from the previous addresses tab to connect phone numbers to
newly-entered addresses.
One of the tabbed subforms, fsubConstituencyCode, contains a field called
ConsCd which populates a table called tblConstituencyCode. Values for ConsCd
can be things like Donor, Alumni, Parent, etc. The are one or more records
for ConsCd for each ConsID.
The next tabbed subform, called fsubGift , contains a combo box called
cboGFConsCd, which is populated (Row Source) via a query called
qryConstituency, which gets its values from tblConstituencyCode, whose
records come from the previous tabbed subform, fsubConstituencyCode. When
entering a new gift, a value is chosen from cboGFConsCd to indicate under
what ConsCd the person is giving the gift (it's possible for a person to give
different gifts under different codes.)
The problem is, when you click on the Gifts tab, cboGFConsCd doesn't
automatically pick up the new ConsCd values that had been entered in the
previous tabbed subform.
One crude solution (which I'm currently using) is to place a command button
on fsubGift to refresh it and populate cboGFConsCd, but this solution is
really not desirable. Moving on and off the master record (ConsID) works as
well, but is of no value here.
Is there some (fairly simple) way to get cboGFConsCd to be populated with
values from the previous tabbed subform when I click on the Gifts tab (for
fsubGift)? I was hoping that I could use something like the On Click event
procedure for the Gifts page, but with my limited VBA knowledge I can't seem
to put together any procedures that will refresh fsubGift or requery the
combo box. Can I use the AfterUpdate event on fsubConstituencyCode (the
previous form) even though I'm entering new records there? By the way,
cboGFConsCd already gets the focus when fsubGift opens, so (I assume) I can't
make use of that event unless I have some other field get the focus first.
At any rate, If anyone has had the patience to wade through this "book" of
mine, your suggestions would be much appreciated.
Thanks
control to be populated with the new values entered on a previous subform
(page) without having to use a Refresh command button on the combo box's
subform.
Details about my application and problem:
I'm developing a simple fund-raising application in Access 2000 (9.0). The
"core" of this application is a master form (frmConstituentRecords) that
contains a tab control with multiple pages. Each page contains one or more
subforms that are used to enter, edit, and review records for an individual.
The master form contains a unique autonumber field (ConsID), that provides
the Child/Master link for each tabbed subform and allows synchronization of
records via ConsID.
Each subform's records are tied to a different table (with ConsID as the
foreign key.)
Each tabbed subform contains records that relate to some aspect of the
individual, like bio info, addresses, phones, gifts, etc. The tabbed subforms
are in a specific order that relates to the way new data is entered for a new
individual. In some cases, a subform depends on the records from a previous
tabbed subform to populate one or more of its fields. For example, the phones
tab uses data from the previous addresses tab to connect phone numbers to
newly-entered addresses.
One of the tabbed subforms, fsubConstituencyCode, contains a field called
ConsCd which populates a table called tblConstituencyCode. Values for ConsCd
can be things like Donor, Alumni, Parent, etc. The are one or more records
for ConsCd for each ConsID.
The next tabbed subform, called fsubGift , contains a combo box called
cboGFConsCd, which is populated (Row Source) via a query called
qryConstituency, which gets its values from tblConstituencyCode, whose
records come from the previous tabbed subform, fsubConstituencyCode. When
entering a new gift, a value is chosen from cboGFConsCd to indicate under
what ConsCd the person is giving the gift (it's possible for a person to give
different gifts under different codes.)
The problem is, when you click on the Gifts tab, cboGFConsCd doesn't
automatically pick up the new ConsCd values that had been entered in the
previous tabbed subform.
One crude solution (which I'm currently using) is to place a command button
on fsubGift to refresh it and populate cboGFConsCd, but this solution is
really not desirable. Moving on and off the master record (ConsID) works as
well, but is of no value here.
Is there some (fairly simple) way to get cboGFConsCd to be populated with
values from the previous tabbed subform when I click on the Gifts tab (for
fsubGift)? I was hoping that I could use something like the On Click event
procedure for the Gifts page, but with my limited VBA knowledge I can't seem
to put together any procedures that will refresh fsubGift or requery the
combo box. Can I use the AfterUpdate event on fsubConstituencyCode (the
previous form) even though I'm entering new records there? By the way,
cboGFConsCd already gets the focus when fsubGift opens, so (I assume) I can't
make use of that event unless I have some other field get the focus first.
At any rate, If anyone has had the patience to wade through this "book" of
mine, your suggestions would be much appreciated.
Thanks