TOUGH problem

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!
 
J

Jesse Aufiero

thanks. the initial value is blank... and setting it to a blank did not
seem to help the problem.

the solution actually turned out to be a simple one. the name of the column
that the combo is bound to had an underscore in it (QB_Type), which access
cannot interpret correctly in the scenario i described. i removed the
underscore (QBType) and things work fine now.
 
D

David F Cox

Hmmm - I use underscores all of the time ... now you have me worried. :-<

I am glad you solved it.
 
J

Jesse Aufiero

welp, good luck. hopefully if you do experience the problem it won't be too
painful to change the column name. ...on the bright side, the problem may
only occur when the form is bound to a linked view, as opposed to a linked
table, making this problem less obscure...
 

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