Combo Box Filter
Jun 6, 2005
I have two combo boxes, Company Name & Name. The data that is selected is used to run a query from a button. However i would like to set it that if the user (but not required) selects the company name then only the names of the people belonging to that company appear, but if no company is selected then all the names for every company appear.
Can anyone make a suggestion as to the best way to go about this.
Thanks
View Replies
ADVERTISEMENT
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
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
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 5 Replies
View Related
Apr 23, 2006
Hi All,
Just after a code or way to filter client details via a combo box.
Basically select combox drop down menu select the sales rep then it filters by sales rep and shows only the clients for that sales rep. I can get it to filter but it does the first client of that sales rep but not the rest.
Thanks
Karl
View 4 Replies
View Related
Nov 12, 2004
I've read several threads about one combo filtering a second combo on a form, but can't seem to find a similar enough situation. Can you please advise on the following:
I have a form based on a query containing a whole load of fields from several tables. In particular the query contains a field called WorkstreamID from tblWorkstream.
Each tblWorkstream record has a Workstream ID, Workstream and foreign key called Project ID from tblProjects.
I want my form to have two combos: one for Projects (unbound) which filters the combo for Workstream (bound to the underlying query of the form)
How do I do this?
Please bear in mind, I am not an expert!
Thanks in advance
Sunil
View 14 Replies
View Related
Dec 14, 2007
Hi,
I have a form with a list box that is filtered by the entry made into a combo box. It works fine except that I want an option which shows all records in the list box. I tried using the formula below in the query criteria for the list box but it returns no records when I select All in the combo box. Why won't it work? Is there a better way to do this? Can anyone help?
IIf([Combo32].[Value]="All",Like "*",[Combo32].[Value])
View 4 Replies
View Related
Jul 24, 2005
hi all,
another quick question (last one for awhile I promise) but is there a way to add an option to a combo box (Filter by Selection) and Remove/Filter sort without right clicking on it?
cheers,
Andrew
View 1 Replies
View Related
Sep 2, 2005
I have a table that has the fields Scheme no, Title, Area, Pole No, Rate No, Description, Quantity. Each Scheme No has a number of Poles attached to it, and subsequently each Pole has a number of different rates attached (eg of table shown below)
On the corresponding form I have ID No, Title and Area in the Form header as they are the same for all fields. Therefore in the detail section I want the rest of the fields. The problem I have is I want the user to be able to choose a pole no from a combo box and show up only the corresponding rates to that pole. So for instance below the user could select in the combo box Pole no YP08 and only the rates used on that pole would show up (in this case it would be just HV99 and its description).
SchemeNo.....Title......Area......Pole Number.....Rate......Description etc
001...............xxx........UK...........YP26.... .......LV01..........xxxxx
001...............xxx........UK...........YP26.... .......HV89..........xxxxx
001...............xxx........UK...........YP08.... .......HV99..........xxxxx
001...............xxx........UK...........YP09.... .......YG67..........xxxxx
001...............xxx........UK...........YP99.... .......LG45..........xxxxx
I hope this makes sense to you. Any help with how I can set up this combo box would be greatly appreciated
View 11 Replies
View Related
Oct 18, 2005
Hi There. Im Trying To Filter Records Through A Combo Box Which Is So Far So Good. However What I Would Like To Do Is Select The Records Through The Combo Box And Have It Return And Populate Only Those Records. Has Anyone Got Any Suggestions To This?
Ive Attached The Sample Database Im Working On.
Cheers
View 3 Replies
View Related
Dec 11, 2005
Pleae take a look at the attached database, open frmUpdate and select an item in Group1.
I get a message box "Enter parameter Value" - Group1.
After I click OK, sometimes I get a run-time error, usually everything works fine until the form is reopened.
Can anyone see my problem.
thanks
Steve
View 3 Replies
View Related
Mar 9, 2006
I have a form with a combo box on it.
I want to use the combo box to query a subform.
So basically when you click on the record in the combo box it will filter the subform based on the selection.
Is there is a simple way or do I need to be more specific about the requirements ?
Any help would be greatly appreciated.
Domble
View 2 Replies
View Related
Apr 27, 2006
I am having an issue with my combo box filter, this set of code dynamically updates the combo box to add any new user and select the accounts that are assigned to them. Given everything works and everything filters, the problem is merely a cosmetic one that has to be fixed.
Basically what is happening is the Combo Box displays "*", and "All Records" but we can not get it too show the "Unassigned" -- any idea why?....
View 1 Replies
View Related
Sep 5, 2006
Hello everybody,
I have a problem.
I want to apply a filter on my form.When I filter on the combobox it works fine.
But when I filter on the date the form jumps into the error handler. Below is the code that I use for my filter:
Sub ApplyFilter()
Dim sFilter As String
sFilter = ""
'Filter on date
If Me.txtFilterDatumMelding = "" Or IsNull(Me.txtFilterDatumMelding) Or Me.txtFilterDatumMelding = 0 Then
If sFilter = "" Then
sFilter = ""
Else
sFilter = sFilter & ""
End If
Else
If sFilter = "" Then
sFilter = "[DatumMelding] = " & "'" & txtFilterDatumMelding & "'"
Else
sFilter = sFilter & " and [DatumMelding] = " & "'" & txtFilterDatumMelding & "'"
End If
End If
'Filter on combobox
If Me.cboFilterCallMelder = "" Or IsNull(Me.cboFilterCallMelder) Or Me.cboFilterCallMelder = 0 Then
If sFilter = "" Then
sFilter = ""
Else
sFilter = sFilter & ""
End If
Else
If sFilter = "" Then
sFilter = "[CallMelder_ID] = " & cboFilterCallMelder
Else
sFilter = sFilter & " And [CallMelder_ID] = " & cboFilterCallMelder
End If
End If
If Len(sFilter) > 0 Then
Me.Filter = sFilter
Me.FilterOn = True
Else
Me.Filter = ""
Me.FilterOn = False
End If
End Sub
I hope that you gus can help me. Could it be that the filter is a string and the date filter field is a date??????
thanks in advance.
View 1 Replies
View Related
Jan 19, 2014
I have at present 2 combo box's that filter, now....... the 1st combo box is a drop down value list that will filter the OPOwner (persons name) for example there are 3000 records and 5 OPOwners, I can for now filter my name in cboOPOwner combo box.
The 2nd box (drop down list) is Status which would be "New";"Open";Pipeline";"Lead" ect...
If I filter my name it brings up all records related to my name and the when I want to filter status it will bring up all records relating to say 'Pipeline' however it will bring everyone's ;Pipeline and not just mine.
What I want is to filter my name in the OPOwner combo box and once all records are filtered in my name then in the status combo box filter what ever I want to look at. example what I want to filter - 'Filter Neil' then 'Filter Pipeline, or filter Lead or New'.
This is the code I have in both combo's....
Private Sub cboOPOwner_AfterUpdate()
If Nz(Me.cboOPOwner.Text) = "" Then
Me.Form.Filter = ""
Me.FilterOn = False
ElseIf Me.cboOPOwner.ListIndex <> -1 Then
Me.Form.Filter = "[OPOwner] = '" & _
Replace(Me.cboOPOwner.Text, "'", "''") & "'"
Me.FilterOn = True
[Code] ....
View 14 Replies
View Related
Mar 19, 2014
I am trying to edit the below code to use 'Form_Select_Batch_Number_Form.Combo9.Value' as the combobox value to filter the records in 'Form_ Remitter_DB_Entry_Form'. I am trying to get the filtering to occur when a button on Form_Select_Batch_Number is selected. Below is my attempt to create the button to accomplish this but it is not functional and needs some work.
Code:
Option Compare Database
Private Sub Command0_Click()
DoCmd.OpenForm "Blank Form2", windowmode:=acDialog
Dim MyValue As String
[code]....
View 3 Replies
View Related
Jun 16, 2014
I am back with another question about Access 2010. I would like to filter a table by using a combo box.
I have several columns in the table, and I would like to filter them by their departments (there are several users in each department)
I have tried using the combo box wizard and select " I would like to search records based on the values in combo box" but the problem is that the department shows up as many times as it is in that table.
I came across another solution which was to create an unbound combo box and link it with the query. and the department criteria would be the following:
[Form]![NameOfTheForm]![NameOfTheCombobox]
but it did not work either.
View 1 Replies
View Related
Dec 7, 2012
I`m using access 2010 version, i have one table(Customer) which has one-to-many relationship to the table(Order), so the Order table contains many records from one single record in Customer. How to create a combobox that filter and show how many orders the Customer has. Example:
Table(Customer)
Line 1 - Crystal
Table(Order)
Line 1 - Water
Line 2 - Cookies
Line 3 - Pens
View 4 Replies
View Related
Jan 15, 2008
Okay I created a database that I am going to use to collect data about a study we are doing.When a participant is added to the database on the main (Participation Details form), it automatically generates an ID and creates a record in a second table/form - a questionnaire (i.e. Athens Questionnaire) that the participants fill out preserving the ID number that was created in the participation details form (I have been able to achieve this).However what I wanted to do next is be able to filter the Athens questionnaire using a combo box which contained all the participant's ID's.I was able to create the combo-box and populate it with the ID's using a query and did not put a control source on it (i used =tblAthens.ParticipantID ....) iand created a sub-form that contained the questionnaire. I did this by creating the questionnaire in a separate form called frmAthens_sub and dragging it from the "explorer window" into my open Athens Questionnaire form. However when I attempted to place code in the "After Update" field of the combo box I keep getting errors and I am not sure why.The code I am using is:Option Compare DatabaseSub SetFilter() Dim LSQL As String LSQL = "select * from tblAthens" LSQL = LSQL & " where ParticipantID = '" & cboSelected & "'" Form_frmAthens_sub.RecordSource = LSQL End SubPrivate Sub cboSelected_AfterUpdate() 'Call subroutine to set filter based on selected ParticipantID SetFilter End SubPrivate Sub Form_Open(Cancel As Integer) 'Call subroutine to set filter based on selected ParticipantID SetFilter End SubIt is highly possible that I am just not doing something right as this is the first time I have used sub-forms. I tried to attach a copy of the database but cant get it below the max. The error seems to be coming from this line --> Form_frmAthens_sub.RecordSource = LSQLIs there an easier way or alternative code for filtering a sub-form from a combo-box?
View 3 Replies
View Related
Dec 13, 2005
Hello everyone!
I think I am asking the impossible, but can't think why it can't be done!
Here's the dilema:
I am working with an unbound form to search a Mobile Register.
On the form I have an unbound combo box which looks up User details from a table (LKP_User).
When I select a user, I want the subform below to filter all the details for that user and show me which mobiles they have.
PROBLEM:
Combo Box has 3 fields, User_ID, User, Dept_ID. User_ID is bound column but not displayed in combo (only User) is displayed.
I need to link the User_ID with the User_ID on the subform, but don't know how to tell it to look at column 1 of the combo box.
Can anyone point me in the right direction? Do I need some fancy code to get this to work?
Cheers in anticipation
NKA
View 6 Replies
View Related
Oct 11, 2006
Hi there!
I am pretty new at this so please bear with me :confused: (like that isn't said a thousand times!). I am creating a small database to track task data (manpower tracking basically) where I have the following fields:
Customer
Functional Group
Task Status
Task Name
Task Description
WO #
Funded Hours
Notes
I would like to create a combo box where the user can select the customer (I have 124 records in total, 15 unique customer names) and all tasks relating to that customer are filtered directly in the Form by clicking a single button to do the filter.
I don't want to create dozens of tables and forms to flip through and such (users need it as simple as possible). I have created queries but the only way I have successfully filtered each customer is via buttons...but 15 buttons to filter each individual customer is a pain in the butt, so any help would be REALLY appreciated.
Please let me know if I haven't explained this clearly enough! :)
Thanks!
View 10 Replies
View Related
Nov 18, 2004
Hello,
This is my first time posting here and I hope someone can help me. I am not experienced with coding in access and only recently started using forms.
I am trying to create a text box that automaticly fills in once a selection is made in a combo box.
There are only 2 tables and 1 form I am working with. Table 1 has columns "code" and "bu". The second table has several columns, all blank, that the form fills in.
The combo box is working correctly, it displays all the "code"s. Once the code is selected I would like a text box to display the "bu" column.
Any suggestions are much appreciated.
View 4 Replies
View Related
Mar 16, 2006
TblCat Contains fields CatID (index) & CatText (Text)
TblType Contains field TypeID (index) , CatID (index) , and TypeText (Text)
Relationship of tbleCat.CatID (one) to tblType.CatID (many)
Forms!Input!cboCat bound to Tables!Inventory!Category
Forms!Input!cboType bound to Tables!Inventory!Type
Intent: Choice from cboCat to provide from list for entry into Inventory.Catagory plus filter list choices for cboType for entry into Inventory.Type.
cboCat :
RowSource : SELECT [tblCat].[CatText], [tblCat].[CatID] FROM tblCat;
Event:
Private Sub cboCat_AfterUpdate()
Dim xxx As String
xxx = "SELECT [tblType].[TypeID], [tblType].[CatID], [tblType].[TypeText] " & _
"FROM tblType " & _
"WHERE [CatID] = " & Me.cboCat.Value
Me.cboType.RowSource = xxx
Me.cboType.Requery
End Sub
cboType: No special RowSource or events
cboCat works fine but cboType has a popup box that asks for the Parameter value for the choice made in cboCat. ( Me.cboCat.Value ???) Where did I go wrong ??
View 5 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
Jun 6, 2014
I have a form that has many fields with the same part number but with a different PO number
Example
part number po number
1 3
1 10
1 15
What I want to do is select the part number and the po number together
Say part number I po number 15
At present my combo box only will select one of these IE THE part number ...
View 2 Replies
View Related
Jan 23, 2014
I have some code in which I enter a startdate and a enddate into textbox's and a combo box where I enter a client name when I run the code it will show all record's generated with in the date range and same client name set in the combo box "cboclient" what I would like to be able to do is have another combo box call cboclient2 which will allow me to enter another client name so then when the report opens it will show me with in the date range set in startdate and enddate and filter the client field by cboclient and cboclient2 so for e.g.
startdate
01/01/14
enddate
11/01/14
cboclient
peter
cboclient2
steve
Run code show all record in date range and with client name peter and steve
Here's the code I have
Private Sub cmdPreview_Click()
'On Error GoTo Err_Handler 'Remove the single quote from start of this line once you have it working.
Dim strReport As String
Dim strDateField As String
Dim strWhere As String
Dim lngView As Long
Const strcJetDate = "#mm/dd/yyyy#" 'Do NOT change it to match your local settings.
[Code] ....
View 7 Replies
View Related