I am using the following code in a textbox (CountryID) to show a country name (CoName) from a table (tblCountry). If the comboBox (cmbCoName) in current form (frmCountry) has no entry then CountryID remains blank, great. If I use the form to add a new entry then CountryID flashes because it does not recognize the entry. Can I use "or" to add another condition in the IIF statement so that it allows the "not in the combobox list" entry?
I have a subform in a form that has a Combo Box that is linked (not sure is that is the correct term) to a field called PartID in a table containing a list of Parts. The list show the Name of the Part (PartName) and other fields.
This all works great except that it allows the user to change the text in the Name of the Part (PartName) field directly from the Combo Box!!!! I really don't want this to be able to happen.I have the "Limit to List = Yes" but it still allows the user to change the value...The "Allow Value List Edits = No"...
I have the below code behind a form so that a combo box will display a specific list of items based on the data in another combo box on my form.
I have two copies of this same form for two different departments. One of the forms works like a dream. However, when I copy that form, change the name, and update the code as pictured below, the form is asking for a parameter FROM MY ORIGINAL FORM and will not requery the combo box. I can't figure out why...there is no reference to the original form in my VBA as you can see below. I tried deleting the form and re-creating it, I tried deleting the code and re-typing it to no avail.
Private Sub cmboType_AfterUpdate() Me.cmboAction.RowSource = "SELECT tblStatusList.Status FROM tblStatusList WHERE (((tblStatusList.Department)=[forms]![frmInquiryFraud]![cmboType]));" End Sub
I have a form where there are 2 list boxes: Part_List and acbPartList. acbPartList has multiselect enabled and what I want to do is be able to select multipler records in that list box and then press a button to add those selected records into the other list box. Here is my code for my button:
Private Sub addItemButton_Click() Dim varItem As Variant With Me.acbPartList_Existing For Each varItem In .ItemsSelected Me.Part_List.AddItem (varItem) Next End With Me.Part_List.Requery Me.Refresh End Sub
I'm not sure if passing varItem is correct, but regardless, it isn't working because Part_List is based off of a query, its not a value list.
I have a combo box in which I wish to show the Person_ID's of every record in the table TBL_Person, except those which are returned by a separate query. Is this possible at all?
I have a form that has three cascading combo boxs, plus a subform. The third combo has a list of questions, and you put your answer in the txt box in the subform.
What has to happen is that the combo box has a number of questions and each has to be answered, is there a way to know if all these questions have been answered by knowing what listindex or listcount ect that has be used and to have something set to advise the user that there are more questions and what ones are to be answered.
I have two synchronised combo boxes that are working brilliantly except for 1 thing.
The two boxes are Site and Building. I find a site from the Site box dropdown and only the buildings for that site are shown in the Buildings box dropdown. Perfect!
However, I have got 3 fields showing in my Buildings dropdown.
Private Sub cboSite_AfterUpdate() Me.cboBuilding.RowSource = "SELECT BuildingName, BuildingCode, Status FROM " & _ "BuildingT WHERE SiteID = " & _ Me.cboSite & _ " ORDER BY BuildingName" Me.cboBuilding = Me.cboBuilding.ItemData(0) End Sub
that is BuildingName, BuildingCode and Status.
All three show in the dropdown BUT only BuildingName shows in the actual Building Box and I would like all 3 to be visible once I have decided on the building name I need!!
Can this be done by changing
Me.cboBuilding = Me.cboBuilding.ItemData(0) (as above) to Me.cboBuilding = Me.cboBuilding.ItemData(0), Me.cboBuilding.ItemData(1), Me.cboBuilding.ItemData(2) or something similar??
Or do I need to create 2 new boxes to return the other values?? I am so close to achieving what I want with this form!!
I have several comboboxes in my database from which users select values. However, in most cases, I do want to give them the option to add an item that does not appear while simultaneously updating the underlying table which stores those dropdown values. I have made use of the builtin "allow edit list items" feature of Access 2007 but the form always opens on the first record of the form on which they are to add the new item. Is there a way to specify that it should open in Data Entry view apart from using VBA?
So I have a combobox that pulls values from a table. I am being requested to do an update to the database which means that I have to filter some values on that combobox based on a field on a previous form.For example:The main form is called "frmcontacts" and has a table field called "txttypeofcustomer" which can have two values: "customer" or "dealer".
The form that contains the combobox is called "frmnewissue" the combobox is called "cmbissuetype". "frmNewIssue" is opened through a button on "frmContacts". This combobox pulls the values from a table "tblissuetype". The values in that combobox are then: "Repair" "Return" "Question" "Replace".
If the value on txtTypeofCustomer is "Dealer" then all the values for the combobox remain visible. If the value of txtTypeOfCustomer is "Customer" then "Replace" cannot be visible or has to be greyed out.
Now I have a combo box "cbo_items" and a text box "txt_selectedItems", I want to populate text field with items selected from the combo box, every time i select an item it appears in text box and to be separated with comma, so text box appears like this ( item1, item2, item3), and after finishing the whole thing the result appears in lable "lbl_result" as "total items selected: 3 items".
I want to create a Multiple Items form presenting Orders table with two Combo Boxes:
1. A combo box to select Order_Category_ID. 2. A combo box to select Order_Type. When 1 (Minor) is chosen in the first combo box it should show Book and Pencil, when 2 (Major) is chosen it should show Car and House.
Examples in the Internet show how to do it on a 'single row' forms using the RowSource property. I tried to use a query like:
SELECT Order_Type FROM Order_Type INNER JOIN Orders ON Order_Type.Order_Category_ID = Orders.Order_Category_ID WHERE Order_Category_ID = [comboBoxOrderCategoryID]
But it sets same values for all records in the Multiple Items form and it should return different values in each rows based on value in the first combo box (Order_Category_ID).
I am trying to avoid to use a Combo Box & a List Box because of the way the records are stored in the table, I only need to verify that the user does not enter a 3 letter code that is not contained in a specific table (I have a table of countries with the 3 letter code example if the user types ESC instead of ESP an error appears) Is it possible to use the after update to verify the contents against a table?
I have a combo box on a form which has a row source type of Value List in which I've manually typed in 2 entries: Owned, Leased.
I have a query which filters on the results of the combobox, and works fine for when I select either option Owned or Leased.
Is there an easy way to filter all (both Owned & Leased)? I've tried leaving the combobox blank, and tried entering a * in the value list, but they both return no results.
Code:
SELECT Assets.* FROM Assets WHERE (((Assets.Possession)=[Forms]![Home]![Combo56]));
Is there a way to make a popup list open on click of a button (cmdAssign) and the user chooses/selects something from the list, then the popup closes and the textbox (txtAssignmentNo) is filled with the choice?
I am using a sequence of combo boxes on a 'Continuous' form.
To reduce the possibility of error I am using a 'Value List' combo box where I use AddItem method to add the previously entered string to the combo control so that it is there for use when entering the next record.
This works fine - but what I want to ask is - how to have a routine to check that the string does not already exist in the combo box before I AddItem i.e., I don't want duplicated values in the list.....
I have a list box and a combo box on a form based on a query. The list box is a multi-select, with column values of Client, ClientEmail, and Medical.
Medical is a simple yes/no field, and it is what I want the combo box to sort by. I have a Where clause in the query: WHERE (Medical=[forms]![frmOne]![cmbbx]), and the only values in the combo box are Yes and No (1 column). I also have the combo box set to run a requery macro after updating. I've also tried to change the macro to VBA:
Code: DoCmd.Requery "lstbx"
When I pick a string from the combo box, the list box just goes blank, rather than updating to clients who either do or don't have Medical, and I can't understand why.
This is a somewhat complicated question to explain, so please bare with me.
I have a form with a ‘list box.’ The box is populated using a Table/Query Row Source Type method. The table I am grabbing the list from is “Department,” where it contains a list of my company’s departments(ie. Accounting, HR, Payroll, etc.).
Now, the only thing this table does not have is the word “ALL.” I need this word in the “List Box” because I want users to have the option to select ALL.
Is there anything in VBScript code wise or in Row Source that I can do to include this word?
I know I can manually go into the Department table to simply add the word, but this is not the point, because there is more to that(I have different list boxes that are grabbing lists from different tables, AND I have to refresh these tables twice a week). Please help.
Hi just started working for a Company and I found they have tons of databases but no structure or standard, so I would like to build a tool that will go thrue a list of databases and get all the table names, the items and type. Is there functions in vba that can get me a list of the tables in the database and the get all the items in the database ?
I have managed to amend records based on the user selecting multiple items in a list box by using the following code.
Set db = CurrentDb() Set rs1 = db.OpenRecordset("Usage", dbOpenDynaset, dbAppendOnly) Set ctl = [Forms]![frmsearch]![lstSelector]
[Code].....
what I need to do now, is to loop(I think) through and amend all the records in a populate listbox, with no selections, similar to above, but without selection.
Code: SELECT tblTrainingType.TypeID, tblTrainingType.Type FROM tblTrainingType ORDER BY tblTrainingType.Type;
My second combo (the one that should be filtered based on the Type chosen above) is cmb_Project_Title. The sql I have written (which isn't working) is:
Code: SELECT tblCourseDetails.CDID, tblCourseDetails.Project_Title FROM tblCourseDetails WHERE (((tblCourseDetails.TypeID)=Forms!frmResourcing.cmb_Training_Type) And ((tblCourseDetails.Type)=Forms!frmResourcing.cmb_Training_Type)) ORDER BY tblCourseDetails.[Project_Title];
Both of the tables that are referenced have the fields TypeID and Type.
On my Class form when assigning students there is a combo box which shows the students names. Once a student is picked in the combo box their name shows up in the subform.
What I would like is a way to NOT show a student in the combo box after they have been selected. Is this possible? Or should I be looking at another way of doing this?
Is it possible to remove an list item from a combo box list after it has been used.
What I am trying to do is use a combo box that has a list of questions, after the user selects a question from the combo box list and answers the question when they reselect the combo box that question will not be seen again till the form is reloaded.
I have a working combo box on a form that displays issue numbers for part number typed into a text box.This all works fine when the list of issue numbers is below the displayed list (16), but when the list is longer than 16 you cannot seem to select anything after item 16.
When the combo box has, say 25 items a scroll bar appears allowing the user to scroll down to item 25, but when you click the mouse the list just reverts back to the first 16 items? The only way to select an item after 16 is to select item 16 which then closes the combo box, then when you reopen it the list now shows items 17 to 25 which you can then select item 25.
This is the same in reverse, when you have item 25 selected, you cannot select item 1. When you click the mouse the list reverts back to items 17 - 25.The combo box is populated in code using the lost focus event on the text box for the part number.