combo box problem on subform

P

Pendragon

Acc03/WinXP (sorry if this duplicates, but the webpage said the server was
too busy and I haven't seen the original post appear)

I have a parent form (frmDues) that among other things, displays the Dues
Year for an individual's membership. The dues year is a combo box
(cboDuesYear). Also on this parent form are two command buttons which allow
the user to scroll (PreviousYear and NextYear) through the individual's dues
history.

The parent form has a subform, frmDuesSelections (as both form name and
control name), which details the selected dues categories for the dues year
based on DuesID from the parent form. A combo box, cboDuesCategory, displays
the individually selected dues categories and autofills the DuesAmount text
box.

In the AfterUpdate property of the command buttons on the parent form, I am
using the Requery function on the subform so that the appropriate year's
records are displayed as the user scrolls through the dues history. This
appears to be working correctly as I can see the Dues Amounts change to the
appropriate amounts as you go from year to year. What is not happening,
however, is the display of the dues categories - these are blank. Only the
most recent year (the current dues year) displays the categories
(descriptions).

The combo box, cboDuesCategory, is based on a database system table with
CategoryID (hidden) as the primary key, CategoryDescription, DuesAmount, etc.

The subform is based on a table which contains DuesID (from the parent
form), DuesCategoryID (CategoryID from the combo box), and DuesAmount
(replicated because it might be a calculation based on the system table dues
amount or manually overwritten).

Is there another command in addition to the requery I should be using so
that the combo box properly displays the descriptions as the user scrolls
through the dues records?

Any wisdom is appreciated.
 
S

SteveM

If you have the Master/Child field links set on your subfrom control, there
is no need to requery it at all. As you change records in the main form, the
subform will automatically show subrecords with a matching DuesID value.

Select the Subform and open its properties.
Set the properties and remove the Requery code and see what happens...

Steve
 
P

Pendragon

I removed the requery. There was no change, but then the records were
refreshing properly anyway (but thanks for the info - I want to keep the code
clean and efficient).

Unfortunately, in moving to a previous dues year, the dues category combo
boxes still show up blank (though the appropriate dues amounts are changing
to reflect the proper year's dues category amount).

Any other ideas?
 

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