Forms :: Setting Up A Combo Box To Filter Another Combo Box
Jan 27, 2015
I'm having a little difficulty setting up a combo box to filter another combo box. I've actually got one working but the second one is giving me all sorts of errors. On the attached database, there's a form called frmAddNewRecord. At the top of the form there's a combo box which allows you to select a name and another combo box beside it which acts as a filter so only names from a certain section are shown (working fine).
The subform which is attached to this form and contains the training details, has another combo box which allows you to select a job...I've tried to add a combo box beside this to filter it but I can't get it to work.
View Replies
ADVERTISEMENT
Nov 5, 2013
i have a table with three column Named
1-State
2-City
3-Customer
on a form i m placing 3 combo box for each column how can i filter combo 2 from table after select value from combo 1
View 1 Replies
View Related
Nov 18, 2014
How do I go about getting data from a:
Text field in Form 1
Clicking a button to run VBA code, and Automatically inserting it into a refreshed combo box in Form 2
I've also attached a pic.
*Also, I'm using Access 2007...
View 5 Replies
View Related
Feb 7, 2015
I have a form that adds a record to a table in the database.I want that when i choose a value from a combobox in the form, it will change the value of another textbox according to what value was choosed.So essentially what i did is simply go to the combobox AfterUpdate and there i used this code:
If Me.Combobox.Text = "Solid" Then
Me.TextBox1.Text = "grams"
ElseIf Me.Combobox.Text = "Liquid" Then
Me.TextBox1.Text = "ml"
End If
But i encounter 2 problems:
1. When i set a default value to the textbox (which i want to), the changing of the value in the combobox doesn't do anything whatsoever.
2. When i remove any default value from the textbox, the changing of the value in the combobox does change the textbox to the corresponding value but then gives run-time error 2185: "You can't reference a property or method for a control unless the control has the focus".
View 2 Replies
View Related
Jun 12, 2014
I have a combo box control in my form named PayDateID, but I told that control to DISPLAY the associated field PayDate.
I now am trying to make a separate control in the same form whose control source is the DISPLAYED PayDate, but it only wants to reference the underlying PayDateID.
How can I make the control source be the displayed value in that combo box?
View 1 Replies
View Related
Nov 8, 2004
I have seen a few articles here and there on using a combo box to filter records in a sub-form and to filter records in another combo box, but I am not getting anywhere. I hope someone can belp
Exercise 1
For this exercise, I have the following tables:
tblClients containing client names
tblProjects containing some project details
I want to set up a simple form, so that the user can select a client name from a combo box on the main form which filters the project detail records in the Projects sub-form.
Once the user enters project details, I want this info as well as the selected ClientID to be fed back to tblProjects.
Exercise 2
I have the following tables:
tblProjects as above
tblWorkstream containiig names of workstreams and some other details.
Every project has one or more workstreams
I have a form where users will enter hours worked on each workstream. They will first select Project from a combo box on the main form. This should then filter records to be displayed in the Workstream Combo box, before they can then enter hours.
Please let me know if you need me to explain any part of this better.
Thanks in advance.
ps. I am a novice, so I'm hoping to do the above using default MS stuff, not with complex programming!!!
Thanks
View 14 Replies
View Related
Jan 15, 2014
In Dec 2013 I created an Access table "Donations" that contains fields regarding charitable donations (Date, Donor, Amount). I use an Access form "Select Donor Form" to select a specific Donor (via combo box) from the table. Then an Access Query "Select Donor Query" uses the Donor selected from the combo box in the form to display all of the donations from that Donor for the year as an Access report.
Since I just created this Access table last month, it only had data from 2013. Now that we are in 2014, in preparation for when I run this report next December, I obviously need to modify "something" to clarify that I want the donations from a specified Donor for a particular year (i.e 2014, 2015, 2016, etc.).
I added a field to the Access table called "Year". I probably can derive the year from the already present "Date" field, but sadly, I don't know how to do that. I want to simply edit the existing combobox in the existing form to return Donors that have a record in the existing table where the Year = 2014. That way, the only changes I will need to make over time is to update which year I need and all of the Donors for that year will populate in the combo box.
Below is the Access macro belonging to the combo box in the form. I converted the macro to Visual Basic. What to add to select the Donor for a particular year. You can see that right now it is only selecting "Donor Name" without regard to which year the donor has a record.
'------------------------------------------------------------
' Combo3_AfterUpdate
'
'------------------------------------------------------------
Private Sub Combo3_AfterUpdate()
On Error GoTo Combo3_AfterUpdate_Err
DoCmd.SearchForRecord , "", acFirst, "[Donor Name] = " & "'" & Screen.ActiveControl & "'"
[Code] .....
View 9 Replies
View Related
May 15, 2013
I am trying to use .Filter for two combo box but it does not work...My code is:
Private Sub btn_buscar_Click()
With Me.FormularioEmpresas.Form
.Filter = "" 'limpiar el filtro
.FilterOn = False
If Nz(Me.cbo_actividad, "") <> "" Then
.Filter = "Actividad='" & Me.cbo_actividad & "'"
[Code] ....
In the the black line appears an error...I do not know why..
View 3 Replies
View Related
Jul 16, 2014
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.
View 1 Replies
View Related
Aug 21, 2013
I have a reservation form and I want to tick a checkbox that will filter the form based on what is in the "Reservation Status" combo box.When the checkbox is ticked, the code would remove all records that have "Complete" as a status in the "Reservation Status" combo box. The non-working code that I currently have is:
Code:
Private Sub chkHideComplete_AfterUpdate()
On Error Resume Next
If Me.chkHideComplete = True Then
Me.filter = "[ReservationStatus] = 1"
Me.FilterOn = True
[code]....
View 7 Replies
View Related
May 16, 2013
combo boxes and continuous forms.I have a continuous form (works great), with two combo boxes that navigate (rather than limit/ filter the list) to the desired selection.One for suburb and one for postcode.
I have expanded the select criteria for the suburb to include postcode as some suburb names are used in more than one state. (I do not want to have to select a state, then suburb).I changed the column count to see the postcode next to the suburb, however when the selection is made only the first instance is selected.
Example.
Epping 2121
Epping 3076
If I chose Epping 3076, Epping 2121 is selected and the continuous form navigates to that suburb (rather than the one with 3076).Can I change this so that I can still search by postcode, or search by suburb and have the form navigate to the corrected suburb postcode combination?
View 5 Replies
View Related
Jun 17, 2013
I am trying to filter a subform based in a combobox. What im doing wrong, is it the Sintax? This is what i have so far..
Private Sub Buscar_Click ()
Dim strFilter As String
strFilter = Me.CombNomes.Value
Me.subfrmBANCO.Form.Recordsource = "[Nome]=""&strFilter&"""
Me.subfrmBANCO.Requery
End Sub
'subfrmBanco is a subform based on a table called "BANCO"'
'[Nome] is the field in BANCO that im trying to filter on
'CombNomes is the combobox im using as filter parameter
View 10 Replies
View Related
Dec 14, 2014
I have a table contains 5/6 column. now i need to filter the table on a form randomly.
Suppose I have 6 different combo box for 6 column. Now on the sub form the control shows the whole table. i this case i have clicked the 3rd combo box, then it will show the whole column in its list. if i select any one of it the table will show the common values below. then i will click the second combobox which will populate the present data shown into the subform table after the first filter.
After that i wish to filter the fifth column where the fifth combobox will populate the data after the second filtering.
By all means the active data into the column will ony populate into the combobox.
View 1 Replies
View Related
May 28, 2013
Currently I have a main form w/ subform. In the main form, a user selects a bond's serial number from a combo box and the subform displays the bond's returns for the months owned along with a start date (each month has its own start date). So if I enter bond ABC in combo box, the subform will display "13-01-01, 4%" for January, "13-02-01, 8%% for February..etc.
So if we owned a bond from January to March, it will display the three months' returns. I want to add two combo boxes: begin and end date so that I can filter the subform to only show a particular set of months' returns.
I have three tables right now: Cusips, which lists each bond's serial number, CusipStartPK, which lists the monthly returns for each serial number, and ParameterDates, which is a list of four start dates--ie 13-01-01 for January, 13-02-01 for Feb, etc.
I've tried parameter queries and vba codes from other threads but I can't get this to work.
View 4 Replies
View Related
Mar 15, 2014
There are 3 column in a combo box, ID is bound column
Part no ID Description
0040 1 class 40-1
0040 2 class 40-2
0040 3 class 40-3
0041 4 class 41-1
0042 5
0042 6
When key in part no 0040, 3 rows under 0040 will be listed out only, filter and match as value entered only. do not show others part no in the combo box selection.
View 1 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
Sep 21, 2014
I have a form called frmSearch with an option group called grpSearch ,a combobox called comboNyaba and subform called subform_CasesSearch has a checkbox called CaseClosed
The combobox filter the subform based on option group choice and value in textbox called NyID ... it works fine except that if the combobox is empty it give me error the code in main form i put it on Load and on current
Code:
Private Sub Form_Load()
With Me.subform_CasesSearch.Form
If Me.grpSearch.Value = 1 Then
.Filter = "NyID = " & Me.ComboNyaba
[code]....
View 3 Replies
View Related
Dec 9, 2013
I am trying to apply a filter to a datasheet subform using a combo box.
This is the code I have used on the "after update" event:
[Ordering - Price list items].Form.Filter = "[Secondary Category]=" & Combo72.Column(1)
[Ordering - Price list items].Form.FilterOn = True
When I run the query i get the following error:
Runtime error 3021:
No current record
I am not sure why it isn't working as this is how I have set up other combo box filters and it worked fine.
View 6 Replies
View Related
Jun 3, 2013
How to properly use 3 cascading combo boxes.
I have them set up and they work, to some degree.
I have three boxes Type/Sub-Type/Item. They all filter down to the next one, the problem is, when I get to the 3rd box, it filters ONLY from the 2nd box and loses the filter from the 1st. What do I need to do to get it to maintain the filter from the first box and then ADD the filter from the second box when populating the 3rd box?
View 2 Replies
View Related
May 8, 2013
I have a database and a form that is based off of a simple table. The table has NO look ups and all of the formatting is text. The form is continuous and simply displays these fields. (Kind of like a company roster with name and department). I have two combo boxes at the top of this form in the header with the intent of filtering the form records by department and employee type (lets say A or B).
I have tried every way I know how to get these records to filter and they will not filter correctly. Utilizing methods I have used in multiple other databases, I set the two comboboxes to cascade based on a query in the recordsource. The vba I'm using in the after event of each combo is ....
Me.Filter = "[Brand] = '" & Me.cbobrand & "'"
Me.FilterOn - True
'Brand is the "department" and the other identical code is for Personel_Type
This filters the records but independently. So, cbobox1 filters the records to show all Brand 1. When cbobox2 selection is made it shows all the Personel_Type of the selection however the first filter is already disregarded. (i.e. When cbobox2 selection is made, it contains both brands instead of the one I've just selected and filtered in cbobox1. )
Outside of making two queries to account for each possible filter, I have tried setting a filter on the filterON, I have tried a SQL based VBA code, I have tried making two forms and attempting to set the filter on open but either way, nothing keeps the first filter selected (or the FilterON, or both SQL filters, etc). The ONLY way I have found to get it to filter both is with the filter function in Access, which is not useful as my users will not have access to the menu bars.
I have this EXACT same setup in another database and it works fine with 3 cbo boxes with an after even to set a filter for the recordsource for all three.
View 5 Replies
View Related
Feb 6, 2014
I have a modal form with a combo box and a search button.
When the button in pressed, the value of the combo box is the parameter of a query.
Copy and paste of the search button code:
Code:
Private Sub btnSearch_Click()
Dim db As DAO.Database
Dim qdef As DAO.QueryDef
Dim strSQL As String
[Code] ....
I've tested the SQL query produced by the search button and it works, but when I try to push the button, I receive an error on the following line:
Set qdef = db.QueryDefs("qryFilteredData")
View 6 Replies
View Related
Dec 29, 2013
I have a form that is filter based on a combo box. I would like to add another filter for date. but the code I'm using for the first combo box doesn't work for date.
the code is:
Sub SetFilter()
Dim LSQL As String
LSQL = "select * from Preventive_Q_View"
LSQL = LSQL & " where Item_Name = '" & Combo206 & "'"
Form_Preventive_View.RecordSource = LSQL
End Sub
How do I modify this code to work with the date combo box? Also, is there a way to get both filters to work together, as in filter based on the first combo OR the second combo, OR both?
View 1 Replies
View Related
Jul 31, 2014
I'm trying to use a cascading combo box to filter the options that can be entered into a second combo box.
In frmBabies, a Mode of Delivery is selected from 8 options. 4 of these are "normal" deliveries and 4 are caesarean sections.
A second combo box selects the Indication for Operative Delivery. The table tblIndOpDel contains options for normal as well as caesareans. I would like to filter the indications so that the user cannot enter an indication for normal delivery for a caesarean section.
Both tblIndOpDel and tblDelMode have a foreign key to tblDelModeCat, which categories deliveries as normal or caesarean.
I'm stuck on how to proceed from here. Sample database attached.
View 2 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
Sep 6, 2014
I have a simple split form with datasheet on the bottom and a couple of comboboxes (unbound) on the form header which the user can use for filtering the data. When some users open the form the allowedit property of the form is set to false, because those users can only view the records. But the result is that also the comboboxes cannot be set, hence no filtering!
View 6 Replies
View Related
Jul 1, 2013
I have a subform with the following fields:
Client name, Country, Country ID
I want to add to every row a combobox with a list of towns depending on the value in the field Country ID.how do I filter the comboboxes individually based on a value in another field on the same row?
View 1 Replies
View Related