M
Michael Suttkus, II
I have a form that features a combo box that is filled by a user-defined
RowSourceType function.
Another combobox on the form selects one of four default filters (no filter,
and three filters to restrict the records viewed to one of our three
campuses.)
When the form first opens, the default "no filter" is selected and the UD
RST combobox works correctly.
When you subsequently select any of the campus-specific filters, the UD RST
combobox again operates as expected, filling up with just the inventory items
found on the specific campuses. It continues to operate correctly if you
switch from one campus filter to another.
However, when you switch back to "no filter", the UD RST combobox's Requery
method is called as expected, but Access makes the remaining requests of the
UD RST function in the wrong order. Specifically, it calls the acLBGetValue
& acLBGetFormat for the previous ID session, THEN closes the previous session
(acLBEnd, acLBClose, acLBEnd), and then starts the next session
(acLBInitialize, the mysterious, undocumented 2, acLBOpen), but never
requests acLBGetValue or acLBGetFormat for the new session. The result is an
empty combobox!
I have a patch for this problem. Calling Requery a second time produces a
new session with the calls to the UD RST function taking place in the correct
order (though it never closes the previous ID session, so if I was opening
resources, this patch would result in a memory leak). But calling requery
twice is not a satisfactory solution.
Does anyone have an idea what's going on here?
RowSourceType function.
Another combobox on the form selects one of four default filters (no filter,
and three filters to restrict the records viewed to one of our three
campuses.)
When the form first opens, the default "no filter" is selected and the UD
RST combobox works correctly.
When you subsequently select any of the campus-specific filters, the UD RST
combobox again operates as expected, filling up with just the inventory items
found on the specific campuses. It continues to operate correctly if you
switch from one campus filter to another.
However, when you switch back to "no filter", the UD RST combobox's Requery
method is called as expected, but Access makes the remaining requests of the
UD RST function in the wrong order. Specifically, it calls the acLBGetValue
& acLBGetFormat for the previous ID session, THEN closes the previous session
(acLBEnd, acLBClose, acLBEnd), and then starts the next session
(acLBInitialize, the mysterious, undocumented 2, acLBOpen), but never
requests acLBGetValue or acLBGetFormat for the new session. The result is an
empty combobox!
I have a patch for this problem. Calling Requery a second time produces a
new session with the calls to the UD RST function taking place in the correct
order (though it never closes the previous ID session, so if I was opening
resources, this patch would result in a memory leak). But calling requery
twice is not a satisfactory solution.
Does anyone have an idea what's going on here?