Forms :: Running SQL Statement With Combo Box Values
Apr 4, 2013
I have a form that has a combobox with table names in it. I want to execute a very complicated SQL statement but I want to put the table name (from the combobox) into the SQL statement. I'm planning on making a button to do this, but I don't know how to put the SQL statement in VBS which would use the combobox value as the table name in the SQL statement.
View Replies
ADVERTISEMENT
Jun 12, 2015
I have a main form with many subforms. Each subform has couple of ComboBoxes or/and TextBoxes. I want to make sure that end users dont miss completing any of required values. For example, in the subform (Clients), an end user is supposed to put either "Male" or "Female" in the (Gender) ComboBox. In another subform (Job Info), the end user will put info of the job like Wage, Employer, Date of Job Start... ete.
What I want is to get VB IF statement which tests if the textboxes "Wage", "Employer", and "Date of Job Start" in the subform (Job Info) are not null, then the CobmoBox "Gender" in the subform (Clients) should not be null too, with a warning message to complete the missing value.
View 14 Replies
View Related
Aug 5, 2013
I have several comboboxes (6) on my form.How to populate these comboboxes with values depending on selected value in previous combobox.
Example.Lets say that you select value "Audi" in combobox 1, then available values in combobox 2 should be "A4","A6","TT" etc. and if you selected "BMW" in combobox 1, then available values in combobox 2 should be "3-series", "5-series" etc...
View 1 Replies
View Related
Jun 25, 2013
I have a main form that filters data in a subform based on selections via combo box users make on the main form.
So I have the 'department' and 'manager's name'. If someone selects 'Human Resources' from 'department' combo box, then I only want to see the managers that are in the Human Resources departement when I drop down the combo box for 'manager's name'. Currently I'm seeing all the managers and a user can select a manager that is not in human resources and get no data returned. I prefer for him to get a list of those that are in that department only. The source of the combo box is a query.
I got it! Found here: [URL] ....
View 3 Replies
View Related
Nov 4, 2014
My form has a combo box which is bound to a query that selects a list of member numbers. The value selected the goes onto filter a list driven by an SQL statement.
Code:
Private Function PopulateADO(qpMemberNo As Long)
Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Set cnn = CurrentProject.Connection
Set rst = New ADODB.Recordset
[Code] .....
This works fine when a single member is selected from the combo. But obviously i want a "select all" or * wildcard option.
Question is 2 parts.
1. How do i add the all or wildcard option to the bound combo?
2. How do i code the all or wildcard option into the SQL statement?
Is it something like is not null ?
View 8 Replies
View Related
Apr 19, 2013
I'm trying to run an if statment, on the records in a field (called "Current_Month"), in an existing table called ""Current_Months_Lag1_Data".
The IF statements work fine - and simply perform a different action for different data in "Current_Month".
I am having problems referring to "Current_Month", where I keep getting 424 (Object required) and 3420 (Object invalid) error messages, on the last line of code.
I have defined & identified the table in which the field is located, yet somehow cannot identify the field within that table. (I've already tried searching the web for similar problems under error messages 424 & 3420).
Function LAG_Forecast_03()
Dim dbs As Database
Set dbs = CurrentDb
Dim Tbl As TableDef
Set Tbl = CurrentDb.TableDefs("Current_Months_Lag1_Data")
Dim FLD As Field
Set FLD = Tbl![Current_Month]
View 6 Replies
View Related
Nov 1, 2014
I am new to access. In a form, I have a combo box(combo1) that store values in field(remarks1) in a table.The values in combo box are:
SL
ST
DI
SL + ST
SL + DI
These all values are being saved in remarks1 quiet easily. I have more fields in the table:
SL1
ST1
DT1
SLST1
SLDI1
I want when I selet SL from combo1 it saves SL in remarks1 and save "1" as well in SL1 field.I want to have same result with all five combo1 values
View 2 Replies
View Related
Jul 14, 2014
I have a combo box linked to table shipstatus. This table has 2 columns. ShipCode and ShipName. These values are delivered, on hand, received, returned, warehouse.
I have another table named manifestdetails and a column labeled shipstatus
I would like to create a form where the user can use the combobox selections from the table shipstatus and update the column shipstatus from the manifestdetails table.
View 3 Replies
View Related
Jul 29, 2014
In my subform, I have a field named Container Type (I know you don't need to tell me about Reserve names for Access, but I can't change the names) where when you choose one of the values (a combo box), the values for a second field (Container Code) changes (another combo box) based on the first selection. Then, based on the selection from the second field five other fields are automatically filled in.
Using:
Access 2010
Windows 7
View 14 Replies
View Related
Jun 25, 2013
I'd like to create a combo-box in a database which takes its values from a field in a table in another db. Both of the dbs are on my computer.
How can I do that?
View 6 Replies
View Related
Jul 22, 2014
I've used this guide [URL] .... to only show unique values in a combo box. I can't get it to work, it just shows a load of blank values. If I run the expression builder part from the background, it works but it doesn't work in the combo box. Not sure what I can post to give more details?
View 13 Replies
View Related
Dec 3, 2013
I have built a database that is fed from tables provided from outside computer systems, so the architecture isn't exactly how I would design it.
I am trying to use a combo box on a form to quickly jump to a specific department. I have about 130 personnel that are assigned to 10 different departments. I have to use a subform to update the position info vs. the personal info.
The combo box works, but I can't get it to display each department once. It shows the department 130 times for each employee instead of 10 unique departments.
View 11 Replies
View Related
Aug 6, 2013
I have a form with two combo boxes. The first box lists switch names from a query, and the second lists switchports from another query. The switchport query lists all the switchports for whatever switch is selected in the Switch Name combo box, and all the settings for that port (one column per setting). I want each text box to display the corresponding data from the switchport query for the switch selected in the first combo box and the switchport selected in the second combo box.
View 3 Replies
View Related
Jan 17, 2014
Am I correct in thinking the only way to have a combo box with different values in each column is to create a table and then bind the combo box to the column you are referring to if you want it to represent a value from another.
For example if I have a combo box with the words January, February etc can that combo box have a corresponding month number value in a separate column (this combo would be derived from a list) or would I need to create a table holding both the month names and numbers and then bind to the name value for selection but use the month number value?
The reason I ask is I wasn't sure if for every type of list I wanted with multiple column values, I would need to create a table.
View 2 Replies
View Related
May 4, 2013
I've got a form (frmMain) with two combo boxes (cmbCategory and cmbProducts). I have set the combo boxes up to be cascading, so that when you select a value in the cmbCategory box, it influences what is visible and selectable in the cmbProducts box. What I wanted to happen is this:
1. User selects a category
2. cmbProducts defaults to the most recently entered Product within that category, and the form pulls up that product's details.
I have the cascading combo boxes set up so cmbCategory has an AfterUpdate event that runs a macro. In the macro is the command to refresh the cmbProducts box, and the cmbProducts box's RecordSource is set to a query that filters the Products based on the value of the cmbCategory box. I then set the cmbProducts Default Value to a DMax command that pulls the largest ID number from the query. Everything works great, except when I choose one category (the correct product comes up, the latest one entered for that product), then go back and choose a different category without reloading the form. The cmbProducts box stays showing the previous Product, and doesn't automatically update with the latest product for the new category. So it works the first time out of the gate, then just stops working, and won't work until I close and reopen the form again.
I've tried the refresh command, and I've tried adding an AfterChange event to the cmbCategories box. Nothing seems to work! I also tried running a close form/open form command in cmbProducts' After Update to enable the DMax command again, but this blanks out my Categories and Products boxes (which it's supposed to... I don't want anything to come up when you first open the form, both should be blank until you start selecting values).
View 2 Replies
View Related
Feb 17, 2015
I'm trying to sort and filter a continuous form. I want to sort by descending and ascending, but I also want to have a combo box for filtering. For example, there a combo box for sorting with Value List as the RowSourceType, the list would be "Ascending" and "Descending", and there should be another combo box to choose the field to be sorted with RowSourceType as Field List from a query.
My field names are: "LastName", "FirstName", "MiddleName". But I want them to appear as "Last Name:, "First Name", "Middle Name". I want to be able to change the display of the field names within my combo box which should come from my query. How is that possible? I already tried to put caption in the properties but it didn't work.
View 6 Replies
View Related
Jun 6, 2014
I am having issues with my combo box populating values based on the selection from another combo box.
Database : contains 2 tables: Staff_List, Level_Type and a form called frm_Test
The first combobox cboLevel gets its value from the Level_Type table with the select statement SELECT [Level_Type].[ID], [Level_Type].[Level_Type] FROM level_Type;
The values to be displayed on the second combobox cbo_Name is expected to be dependent on the Level selection made from the first combobox i.e if Level 1 is selected in cboLevel then only Names of people in Level 1 will be displayed in second combobox.
The select statement I put there is SELECT Staff_List.ID, Staff_List.Staff_Name
FROM Staff_List
WHERE ((([Staff_List]![Level])=[Forms]![frm_test]![cboLevel]));
This is not displaying anything in the second combobox after I tried it in the Form view, just empty.
View 3 Replies
View Related
Jan 17, 2014
Access 2010
windows 7
The database I'm working on stores product records. To support the user narrow down which product they want to use, the navigation form has a listbox that looks to several combox values to filter the records it displays. As the user selects values for additional comboxes, the list of products from the listbox is refined. What I would like to do is set the comboxes up so that they also have to check the listbox to determine which records they should display.
For example:
Comboxes: Customer, Species
Starting out the listbox shows all products. The user wants to find a particular product that is sold to "Harly Quinn's Crab Imporium". They select "Harly Quinn's Crab Imporium" from the customer combobox. The listbox updates to show only products sold to Harly Quinn. The database currently has this functionality. What I want to add comes next:
The user determines that there are still too many records being displayed in the listbox, so he/she attempts to refine the search further by selecting a species from the species combobox. Currently all species from the species table are selectable from the species combobx, meaning that if the user selects a species that isn't sold to Harly Quinn, that the listbox will show no records. What I would like the combobox to do is refer first to the listbox and determine which species are still viable options based on the records available from the listbox.
View 1 Replies
View Related
Aug 25, 2014
Field B is a combo with the options of : 100% Availability, 75% Availability, 50% Availability, 25% Availability, OR Not Available
If I choose "Present" in Field A, I want the "Not Available" value to disappear as an option.
View 2 Replies
View Related
Mar 4, 2015
I have a multiple column combo box on my form, that is correctly populating. When I make a selection, it displays the result from the first column. Bound column seems correct, as my table is being populated correctly.
1 - Can I display the values from both columns after the selection has been made?
2 - If not, can I choose to display the second column (not the first) after the user has made a selection?
View 3 Replies
View Related
Jul 17, 2013
I have an unbound combo box with three columns, which get the values from a query. The first column is hidden. When I close the combo box after my selection, only the second column value is shown on the box. Is there any way that both the second and third column being shown on the box after selection?
View 3 Replies
View Related
May 20, 2013
I want to insert obtain marks of the subjects. Find the attached my db. when i select combo value my requirement is to insert the all records which associate with the combo. but when i select combo value it will happen nothing.
View 7 Replies
View Related
Jul 9, 2014
In my form my combo box displays a list from a query called DORP-HDR that has 3 columns
DORP-ID | CODE | NAME
and displays them like that is the drop down list
The form field that the combo is bound to takes the numeric-id field as its value. In the combo control wizard i nominated that value, and in the properties pane bound column value is 1.
and in the properties pane the row source is:
SELECT [DORP HDR].[DORP-ID], [DORP HDR].[CODE], [DORP HDR].[NAME] FROM [DORP HDR] ORDER BY [NAME];
So far so good. I have created lots of combo boxes before like this.
But this time i want the second field in the list (CODE) ALSO bound to another field in my form . So I want the combo to transfer two values not one. How do i do this?
View 4 Replies
View Related
Nov 2, 2013
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"...
View 2 Replies
View Related
Jan 25, 2015
I'm working on a table for work which will serve as a database of bins and the products currently in those bins, as follows:
ID Bin Amt Product
1 34 25 110001
2 33 15 200005
3 32 23 110003
etc.
Basically: employee A will use a form to update "Bin 34" (ID=1), with information (Amt, Product) until it is emptied by employee B and cleared using a separate form. No new records will be made or deleted, just the adjacent fields (Amt, Product) cleared and filled in and cleared again over and over.
What I'm trying to figure out is, when employee A clicks on the combo box on his/her form to select a Bin and enter information, how can I filter what is listed in the combo box to display only those bins which have no values under Amt & Product. The real-world risk of overwriting a bins fields before it has been cleared by employee B (who physically empties the bin) can be extremely high monetarily so I am trying to reduce that risk by eliminating it from the combo box until employee B has cleared those fields.
View 1 Replies
View Related
Sep 23, 2014
I want to add a combo box to a form, where depending on the values entered in the box another combo box would show more values. In other words, if the first combobox had choices of 1, 2, 3 and 4, if 1 was selected the next combo box would have values a, b, c and d. If 2 was selected, it would have values of a, d, e, f and g.
View 2 Replies
View Related