J
Jesse Aufiero
I have a combobox that is bound to a column in the linked sql view that
supports my continuous form. The combobox displays a user-friendly
description, but a unique numeric ID is what is actually bound to the
underlying column in the view. The combobox is locked, as are all the other
textboxes on the form.
The problem begins when the user sorts the form by the value in the
combobox. Because other forms can be opened and closed via a custom toolbar
at the top of the screen, the user has the ability to click on the toolbar
item that represents the form in question multiple times. The VBA code
behind this click is simply docmd.openform "formInQuestion"... etc. HERE'S
THE PROBLEM. If the user has sorted by the combobox and then clicks the
toolbar button again, triggering the form to re-open, the user is prompted
for a parameter value!
The parameter value refers to the lookup column associated with the combobox
that the user has sorted by. Going into design view of the form at this
point reveals that when the user sorts by the combobox, the corresponding
lookup column is placed in the OrderBy property. But when the form is
reopened via my VBA code, the form no longer knows how to interpret the very
lookup column that it placed in the OrderBy property, and so the user is
prompted!
How can I get around this? Attempts to clear the OrderBy property via VBA
code have failed. Closing the form with acSaveNo before opening it again
are not an option because doing this causes the screen to flicker, even with
echo off. Any ideas?
Thanks!
supports my continuous form. The combobox displays a user-friendly
description, but a unique numeric ID is what is actually bound to the
underlying column in the view. The combobox is locked, as are all the other
textboxes on the form.
The problem begins when the user sorts the form by the value in the
combobox. Because other forms can be opened and closed via a custom toolbar
at the top of the screen, the user has the ability to click on the toolbar
item that represents the form in question multiple times. The VBA code
behind this click is simply docmd.openform "formInQuestion"... etc. HERE'S
THE PROBLEM. If the user has sorted by the combobox and then clicks the
toolbar button again, triggering the form to re-open, the user is prompted
for a parameter value!
The parameter value refers to the lookup column associated with the combobox
that the user has sorted by. Going into design view of the form at this
point reveals that when the user sorts by the combobox, the corresponding
lookup column is placed in the OrderBy property. But when the form is
reopened via my VBA code, the form no longer knows how to interpret the very
lookup column that it placed in the OrderBy property, and so the user is
prompted!
How can I get around this? Attempts to clear the OrderBy property via VBA
code have failed. Closing the form with acSaveNo before opening it again
are not an option because doing this causes the screen to flicker, even with
echo off. Any ideas?
Thanks!