Manual entry on dropdown form field - yii2

I have a form with a dropdown field which lists several location names. But I want to have an "other" option and when users select it, they can fill it with location name that isn't included in the list.

The good news is that selectize.js does exactly it.
Selectize is the hybrid of a textbox and box. It's jQuery-based and it's useful for tagging, contact lists, country selectors, and so on.

Related

Displaying Related Records based on Selected Value From Dropdown List

This is my data model:
.
Can anyone please explain, how I can make a Form in MS Access, which works in the following way:
There is a dropdown list from which a user selects business unit (Business_Unit_NAM).
After the selection, on the same form, the respective records are shown below, for example, Service_Request_NAM, Service_Request_Description_NAM, Phases, Subphases, Status.
A user can scroll through every of the created records and change the value in the fields.
A more detailed explanation would be extremely appreciated.
Thanks!
You can create a form with Business_Unit dropdown (unbound) and with subform based on TBL_Star_Requests. Link this subform with dropdown control using Link Master Fields and Ling Child Fields properties. That should be enough for requested functionality. If the dropdown on the main form will be unbound, Subform Field Linker will give an error, but it will work anyway if you add field names manually. You can use the Linker if you temporarily will bound the main form to TBL_Business_Units table and bound the dropdown to Business_Unit_ID field. Remove bounding when linking done.

MS Access: Display multiple specific records on one form (not using multiple items)

tldr: I want to create a form where specific fields from specific records are displayed based on filters or parameters. I do not want to use a subform or multiple item form.
the context: I am creating a database with information about different countries. My table Indicators (picture 1) contains country names, indicators names (e.g. Population, GDP, ...) and the respective values. I will collect data on the same indicators for every country.
I want to create a form where I can select a country, and then display the values of the indicators are for that country (picture 2).
I do not want to use a multi item form, because I want to create a visually appealing layout.
I have made a sketch of my data table
And the form I want to create
EDIT: Actually the form should look more like this, i.e. not a tabular layout.
I would be greatful for any suggestions how to build such a form.
You can start with the form wizard to generate a simple data-bound form from your table. Then you can change it to show one record at a time, make all the controls read-only, and add a combo box to select the country and add a little VBA event handler to the combo box so that whenever its selection changes, the form navigates to the record for that country. Of course, in a form you can customise the layout to show indicators in any style you want. So this approach should fulfill all your needs.
With very little effort, I can get the following form and subform:
A little more tampering with the layout, and you can have exactly what you want.
To fill in various boxes, you can use DlookUp and you can use a recordset to write to your textboxes, but it is all quite messy.

Can I create a drop-down list (as opposed to a combo box)?

Creating combo boxes in Access is easily enough. However, drop-down lists are slightly easier for users when there's no need to edit or add values to the list.
Is there a property I can set to make a combo box control manifest as a drop-down list? Is there a custom ActiveX control available with drop-down style?
See whether the combo box .Dropdown method gets you close to what you need. I cribbed this example from the Access help topic:
Private Sub SupplierID_GotFocus()
Me!SupplierID.Dropdown
End Sub
If I am understanding your phrase "manifest as a drop-down" correctly, I think you mean that you want to restrict the user to selecting from a set of pre-populated options only.
Provide a List of Approved Values to Select
For example, if you want them to select a Month, and there are only twelve valid entries Jan-Dec, you can provide a list of months from a query, table, or direct input into the Combo Box's Row Source property.
Keep the User from Adding New Values or Editing Existing Values
What I think you may mean by "manifesting as a List Box" is that you can also then restrict the user to only selecting from your provided values by setting the Limit to List property of the Combo Box to Yes. Setting this property will restrict your users to your list, and not allow edits or new list entries. Remember to take addition steps if you need to make sure the user has selected one of your list values.
Use Dropdown and an Event like On Got Focus together
The Dropdown method "opens" the list so that the user can see the available options. For example, you can set it to the control's On Got Focus Event property so that the user will see some or all available options when the focus is set to this control.
Best of luck!

Access 2007 VBA : Building a listbox with selection choices from another list box

So there are 8 categories that may be associated to each order, but not necessarily all of them. So i was going to build a list box that allowed the user to double click each of the category they wish to associate when they have an "Order Detail" form opened up (unbound form that has hidden text boxes with all needed ID numbers).
I want to have another empty text box right beside it that will allow me to append the selections (up to 8) so the user can see that they have been added.
So one list box with the default choices, and when a choice is double clicked, it adds that choice to the second list box to see the tally so to speak.
What is the VB for getting something like this done?
Thanks
Justin
I suggest that you are making life difficult for yourself. Create a subform with the Order Detail table and a combobox that allows the user to select the various categories.
If you want two list boxes --- one for available choices and another for selected items --- and the ability to move items back and forth between available and selected, it can be done with VBA, but is not trivial. See How do I select items using dual list boxes? for an example.
Personally I favor Remou's suggestion if you can make that work for your situation.

Access 2003 VBA: Return only the index of the last item selected in a ListBox

I will preface this with saying, this is my first time using listboxes and earlier posts were criticized for lacking detail. So, all help is greatly appreciated and I hope this is enough information without being overkill.
Currently, I have a listbox updating a junction table with an on click event (iterates through selected items and if they are not in the table it adds them). The list box is also updated by an option group (based on the option group value a query populates the list with the appropriate items and they are selected/highlighted based on the junction table). Also, when items are a "sub-category" the "category" is also selected. This functions perfectly until I ask it to do more...
Problem 1: I need to differentiate "categories" of items from each other. So, I have included a blank item to the list box to add a space between categories. When the blank items are present the listbox does not update the junction table properly and vice versa.
Problem 2: My users want to be able to deselect the "category" under certain circumstances. This is fine, just de-select the "category" after the "sub-category" is selected. However, the "category" is re-selected whenever the listbox is clicked again because it iterates through all entries.
Perceived solution for both problems: Return only the index of the item (de)selected and manipulate accordingly. Is this possible? If so, how?
OR: Should I take a different approach?
One can think of a list or combo box as a low-resource sub-form. Conversely, one can use a sub-form to take care functions usually handled with a list or combo box.
I don't understand all that you're trying to do, but I do know that "up-sizing" to a sub-form is usually the answer when a simple control (for whatever reason) can't cover the need.