Combobox Locks up after being hidden/unhidden (1 Viewer)

jeffreyccs

New member
Local time
Today, 00:01
Joined
Nov 10, 2012
Messages
29
Hi

I have a form used for selecting reports via option buttons and one option is to select individual students from a dropdown list.

I had intended that the combobox and label would be hidden until selecting the relevant option button. On selection the combobox becomes visible but the dropdown does not work, not even showing the white bar when there is no row source. I have tried with some test comboboxes and they all act the same. Making the combox hidden/unhidden again on the lost focus event does not change the locked element. I have tried removing and reattaching the query used to populate the combobox but with no effect.

I have not been able to find any similar situation online and thought I would ask here to see if anyone has come across anything similar.

Many thaks in advance for your advice

Regards

Jeff
 

CJ_London

Super Moderator
Staff member
Local time
Today, 08:01
Joined
Feb 19, 2013
Messages
16,612
sounds like you are using a multivalue field in an underlying table? Generally a bad idea as they come with issues. This may be one of them. However just hiding a control should not impact the rowsource or the locked property.

So it may be something you are doing (or not doing) and suggest you show your code for hiding/unhiding, the rowsource to the combo and it's locked/enabled status.

Don't understand what you mean by
I have tried removing and reattaching the query used to populate the combobox
If it is a multi value field you are using, you would not be doing this
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 03:01
Joined
May 21, 2018
Messages
8,529
I interpret this different than @CJ_London. I interpret this to be a simple combobox (I do not see mention of multi value field), that is hidden. The user clicks a command button and the combobox is made visible. When visible there appears to be no rowsource nor does the combobox drop down. So you cannot select an item from the list. I interpret this to mean it does not drop down.
not even showing the white bar when there is no row source

My guess is that you have it disabled. This will keep the pull down from working. Please provide any code to show and hide or the db itself.
 

561414

Active member
Local time
Today, 02:01
Joined
May 28, 2021
Messages
280
Check the attached database, it's a very simple approach that should give you a north. How does your options code look? Maybe you are using the wrong events.
 

Attachments

  • Database18.accdb
    396 KB · Views: 72

jeffreyccs

New member
Local time
Today, 00:01
Joined
Nov 10, 2012
Messages
29
Hi

Sorry for the delay in replying.
I am attaching a small sample illustrating the problem

Thank you for your assistance

Regards

Jeff
 

Attachments

  • Test.accdb
    388 KB · Views: 77

jeffreyccs

New member
Local time
Today, 00:01
Joined
Nov 10, 2012
Messages
29
Thanks for the example

I had used different events got/lost focus for the option button which seemed to be okay apart from causing the strange problem.

It just goes to show that you can never be quite sure.


Once again thanks to you all

Regards

Jeff
 

561414

Active member
Local time
Today, 02:01
Joined
May 28, 2021
Messages
280
Thanks for the example

I had used different events got/lost focus for the option button which seemed to be okay apart from causing the strange problem.

It just goes to show that you can never be quite sure.


Once again thanks to you all

Regards

Jeff
That's gotta be the problem, when the option loses focus it hides the combobox or something like that. Target the value change, not the focus.

Check this out:
"When you select or clear an option button that's bound to a Yes/No field, Microsoft Access displays the value in the underlying table according to the field's Format property (Yes/No, True/False, or On/Off).

Use option buttons in an option group to display values to choose from.

It's also possible to use an unbound option button in a custom dialog box to accept user input."

Use an option group as in the example I provided and you will be safe.
 
Last edited:

MajP

You've got your good things, and you've got mine.
Local time
Today, 03:01
Joined
May 21, 2018
Messages
8,529
The following is happening. When option 2 gets focus it shows the combo. When you click in the combo option 2 loses focuses and the combo is hidden. But because of the tab order, the focus goes back to the option group and since option 2 is selected it gets the focus. Which cause the combo to immediately show. Rinse and repeat.

When working with options ALWAYS use the value of the frame and the frames on change event. Your code should simply be

Code:
Me.cbStudents.Visible = (me.frameRep = 2)
 

Users who are viewing this thread

Top Bottom