Can a combo box be used to control a list box? - ms-access-2013

Can a combo box be used to set the criteria for a list box? I have a combo box, State, that is the main criteria selection for many of the controls on the form that reside in subforms. I can get those controls to work if they are combo boxes or text boxes, but not in a list box. What I need to do is have the user select 1 of 3 states, then based on that selection, only certain habitats will appear in a list box. I am VERY green and really don't understand VBA.

Except if the Listbox is set to multiselect, it behaves like a Combobox, thus your secret code working with a Combobox will work with a Listbox as well.

Related

Eclipse scout neon whole area around check box is clickable

I noticed that whole area around check box is clickable.
Is this a intentional functionality or a GUI bug? Problem is that user don't expect that if they click outside check box that value in chack box is changed.
It is intended that the user may click on the label. But clicking on the white space right of the label should actually not change the value. We will look into this.
It is different for list boxes: Because list boxes support selection as well, we decided to make only the check box clickable instead of the whole row to prevent the user from accidentally change the checked state if he just wants to select / focus a row.

Positioning mouse cursor on another Application's List item entry based on its text value

I want to do an automation using Excel VBA. First of all I am not sure if its possible so I need to explain the problem first.
I would launch an application which has a list of reports , that one can run by right clicking on any of these and selecting an entry from the popup menu caled say "Run this report". The problem is the report names are displayed in a listbox.
There are so many entries I only need to run a few of them based on their names.
To achieve this I thought about placing the mouse cursor on the text displaying the appropriate report name and then trigger the right click event. These can be done using Windows APIs.
The challenge I am facing is how to hover my mouse on any particular list item based on its display text.
I can enumerate all the windows controls based on the handle of the application's window, but is it possible to get the location of any item on the screen based on the text displayed on list item.

Ajax-like appearing/disappearing elements in Access 2010 web database project

I'm trying to have a feature to allow users choose two different methods of cost calculation: either they can enter a yearly cost breakdown on a datasheet (2010: $10,000, 2011: $12,000, etc) or they can enter a flat yearly cost multiplied by the number of years they select.
If I were developing another kind of web application, I'd have radio buttons to select two different options. One option would display the datasheet, and the other option would display two text fields to enter values into. However, I understand that you can't have radio buttons in Access 2010 web databases. Also, is it possible to make elements appear and disappear based on a combo box selection?
If not, perhaps I could have two different combo box options: "enter yearly cost breakdown"
or "enter flat yearly cost," which open the correct respective forms as pop-ups.
So, 1) can I have Ajax-like appearing and disappearing elements as triggered by a combo box (or ideally, radio buttons), and 2) if not, can anyone think of another clever way of doing it?
Sure, you get a nice effect by using a tab control. You can place controls and even a sub form on that tab control.
So, you build a screen like this:
Then, simple set the visible property of the second tab = No. This will hide the tab (don't change this until you built the page since it will hide it! (use property sheet to hide/un-hide during development).
Now, add some code to the after update event of the list box. Like this:
In the above, I have named the tabs PYear and PFlat.
The result is this (this is a animated gif I inserted):
Of course, you really probably could just dump the whole "list box" selection, and use a screen like this with the tabs (tabs are good UI, and users tend to grasp them quick):
So, you can hide a "set" of controls, and it really far less work and hassle then writing a bunch of JaveScript anyway. As noted, the "set" of controls you drop into each of the tabs can be sub forms, and also that of continues forms. So, the "hiding" as a set does work well in this case. I did have some format issues and found that I had to "start out" with the 2nd tab dispaled first (the first one being hidden). As noted, the listbox selecting is nice, but one could likly just go with using tabs in the first place.

Combobox dropping up?

Is there a way to make combobox be dropping up instead of down?
I have answered that Q but it's in Delphi (the code is not so hard to understand though):
Can I programmatically set the position of ComboBox dropdown list?
You need to subclass the ComboBox hwndList (You obtain that handle via GetComboBoxInfo API) using SetWindowLong (GWL_WNDPROC) and handle WM_MOVE message to place that hwndList in a new position.
Not with the standard Windows combo boxes (Here are the available styles for combo boxes).
As #ILMV said, Windows will drop the box up instead of down if there is not enough space below the box.
You can test this with notepad - go to format -> font, and drag the box down so that the Script combo box is just above the start menu. Click the combo box - it drops up.
If you want it to always drop up, you'll have to make your own.

How do I edit a cell in an MFC Listbox?

I have a CListCtrl control that has 2 columns and any number of rows. I want the user to be able to click(or maybe double-click) a "cell" and be able edit the text therein.
What I mean is that I want to be able to click and edit any of the places where it says "TEST" by clicking on the text to make it editable.
How should I go about this? I suppose I should use a mouse click event but how would I make the cell editable?
This looks like a list control in report mode, which is different from a list box. A list box doesn't support editing contents at all. You can write code entirely on your own to get the contents of a line, copy that to an edit control, display the edit control exactly where the existing content was shown, allow the user to edit, and copy data back when/if the user hits return.
A list control allows editing of one (and only one) field. If you want to support more, you have a couple of choices. One would be about like above, creating your own edit control in the right place. The obvious alternative would be to look up one of the many grid controls. CodeProject has a number of variations.

Resources