Re: Combo goes blank on form requery



Hi Jeff

There are several variations on this little issue.

There's a valid case where the combo's Bound Column is not its display column, and the RowSource is filtered in such a way that it does not have the record it needs to display. (Given your experience, I doubt this is your issue.)

Access does have some serious display problems where a form returns no records (not even the new record), and so the Detail section goes completely blank. In this case, it becomes bamboozled about any controls in the Form Header or Form Footer. More info and a sample:
Incorrect display of data
at:
http://allenbrowne.com/bug-06.html

There is also a timing bug in Access where it fails to display the data correctly after a requery. This occurs in all versions of Access, but only in combos where the bound column is not the display column. If the combo is selected, the selection may even be the width of the characters, but the characters are not visible. I don't know how to prevent this. A Requery in Form_Current won't do it (seems to be too early.)

There was one quirky workaround that involved placing a text box over (or was it partially behind?) the combo, which seemed to affect the way Access updates the screen. Can't recall if you had to set the Transparent property to get this to work.

It's darned annoying. The only real workaround I know of is not to make the combo's bound column the first visible column. For example, intead of a lookup table like this:
CategoryID AutoNumber
Category Text
use:
CategoryID Text
SortOrder Number
The foreign key is then a Text field, so you don't hide it, so the problem doesn't occur.

HTH

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jeff" <no-reply@xxxxxxxxxxxx> wrote in message
news:4725682b$0$17150$5a62ac22@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I don't remember this being that hard. Or maybe it's just early senility.

On a simple bound continuous form I have a combo for filtering the form by customer. The form record source is a sql statement that checks the combo and filters accordingly. The combo simply requeries the form.

More often than not the selection in the combo disappears after the requery, though not always. The only consistence seems to be that if the result is no records then the selection is gone, but if there are records then it may or may not remain.

And sometimes if I click on the combo the selection will return.

Life gets stranger by the day. Is this all a test? Is someone really watching and designing these little tests to see if we crack under the pressure. I laugh...ha..ha..ha. I shall never break, though I may bend I shall always return to an upright position. Am I raving. No. I am alright. Everything is in place. I am home and still.......what was that? Wait....footsteps....aaaargh........

Jeff
""
http://www.asken.com.au

.



Relevant Pages

  • Re: Combo goes blank on form requery
    ... Pick a customer and it may or may not display the selection. ... There's a valid case where the combo's Bound Column is not its display ... Requery in Form_Current won't do it ...
    (comp.databases.ms-access)
  • Re: Combo Box
    ... in the first column (which is the bound column but zero-width, ... I want the dropdown to display the status items, ... selection, but have the ID stored instead of the status item. ...
    (microsoft.public.access.forms)
  • Re: Combo Box
    ... the first column (which is the bound column but zero-width, ... I want the dropdown to display the status items, ... I'd like the status item to be displayed after the selection, ...
    (microsoft.public.access.forms)
  • Re: Make a sub form visible with a combo box selection
    ... The bound column is Column 1 and it ... combo box selection to make visible a sub-form located on ... before the sub form will display. ...
    (microsoft.public.access.forms)
  • Re: Displaying only specified values-not using Autofilter
    ... now that you want to make a selection from the "1"s on Sheet 1 and have ... be assigned to Shift A,Shift B, and Shift C. ... I'd like sheet one then to only display those selected items. ...
    (microsoft.public.excel)