With the MultiSelect Property set to None, it makes no sense for Me.lbxManager in the VBA editor to pop the error
Compile Error:
Invalid use of property.
And when things simply make no sense, I always wonder about corruption!
Although we usually think of Forms, and even entire Databases, when we speak of corruption, Controls, such as Listboxes, can and do become corrupted, and seem particularly susceptible to this during app development. The test/cure for this is short and simple...delete the Control and then re-create it.
Linq ;0)>
Column Count = 1
Row Source Type = Value List
Bound Column = 1
I have deleted and re-created and now when it hits this line it shows 0 even when I selected an item.
Code:If Me.lbxManager .ItemsSelected.Count = 0 Then
Create a new list box and select "I will type in values" option and enter 3 values for the list. Then see if you can select one of those and with code OnClick, see if it moves to your text box with no issue. This is just a test to see if it can tell where issue is.
I think I see what is causing this to be NULL. I have been just clicking the down arrow for the list box to populate the list box with the value, and when doing thisprints NULLCode:Debug.Print Me.lbxManager
but if I actually click the arrow and choose a value, THEN click inside the cell my OnClick() Event will produce the value selected from the list by usingWhich leads me to my next ? --> is there a way to store the value w/o having to actually click in the list box itself?Code:Debug.Print Me.lbxManager
I am wanting to use the value fromin myCode:Me.lbxManagerevent. How can I pass that value to this event? (which is what I was doing unsuccessfully in the beginning...Code:cmdSave_Click
Curious.... I have never seen a list box with a down arrow...... A combo box , Yes, but not a list box......
A list box can have a vertical scroll bar..... but no down arrow.....
I'm just sayin..... makes me wonder..
BTW, "cell" is Excel terminology, not Access...
The OnClick event of both Comboboxes and Listboxes only executes when a selection is made! They don't fire when simply clicking on the Control, whether it be the DropDown on a Combobox or the Scrolling Arrows on a Listbox. You cannot select an item by simply scrolling up or down...you have to actually select it by clicking on it.
Linq ;0)>
![]()
Aha, my bad. I have never used a list box that was one row tall, always around 8 rows tall. I have always used a list box to display multiple choices/options.
Instead of a one row high single select list box, I would use a combo box.
In any case, yes, you MUST click on the selected option in the list box to select an option - doesn't matter if the list box is 1 row tall, 8 rows tall or 16 rows tall. Try making the list box taller and you will see....
(I learned something new)
There's really not much point in doing so...is there? The whole idea is to be able to see a fairly large display of selections without using the DropDown of the Combobox...if you're not going to do that, you would, indeed, be better off using a Combobox. I usually have the cbo dropdown on gaining Focus, which will show multiple selections without chewing up a lot of real estate, when not actually being used.
Linq ;0)>
Ah, well be that the case. I think I will leave it as just a bound text box for now at least. Ideally, I want to limit what the user inputs, however I can not gauruntee that they will actually click inside of the text box and not use the arrow to select it from the list.The OnClick event of both Comboboxes and Listboxes only executes when a selection is made! They don't fire when simply clicking on the Control, whether it be the DropDown on a Combobox or the Scrolling Arrows on a Listbox. You cannot select an item by simply scrolling up or down...you have to actually select it by clicking on it.
Linq ;0)>
Glad my absolute newbieness was able to teach you something, and not frusterate you to no end!![]()
Aha, my bad. I have never used a list box that was one row tall, always around 8 rows tall. I have always used a list box to display multiple choices/options.
Instead of a one row high single select list box, I would use a combo box.
In any case, yes, you MUST click on the selected option in the list box to select an option - doesn't matter if the list box is 1 row tall, 8 rows tall or 16 rows tall. Try making the list box taller and you will see....
(I learned something new)
All I am after is a way to only allow specific inputs into the text box. That way I am not getting garbage into the database (at least not form this angle).
Why not use a combo box???