Forms :: Filtering A Combo Box On A Subform From A Combo Box On A Main Form
Apr 27, 2013
I have a Suppliers database which contains a form that will allow me to place orders with Suppliers.The Main form has a combo box that allows me to select the supplier. The combo box is called SupplierID with the following:
Row source: SELECT Suppliers.SupplierID, Suppliers.CompanyName FROM Suppliers ORDER BY Suppliers.CompanyName;
The subform is called Stock Subform witha combo box called ProductID with the following:
Row source: SELECT DISTINCT Products.ProductID, Products.ProductName, Suppliers.CompanyName, Products.Discontinued FROM Suppliers INNER JOIN Products ON Suppliers.SupplierID=Products.SupplierID WHERE (((Products.Discontinued)=0)) ORDER BY Products.ProductName;
Event Procedure - AfterUpdate: Private Sub ProductID_AfterUpdate()
On Error GoTo Err_ProductID_AfterUpdate
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function.
strFilter = "ProductID = " & Me!ProductID
[code]..
The Link fields are done on the Purchase Order ID (PONoID).What I want to achieve is to select the supplier from the combo box (SupplierID) on the main form and then the combo box (ProductID) on the subform to filter to only show products directly supplied by the Supplier selected on the Main Form.
View Replies
ADVERTISEMENT
Apr 21, 2015
Within my main form I have a combo box called "workgroup." Also in the main form is a subform called "sfrmSubmissionRecords," and within this subform is a combo box called "covermemo."
Each cover memo is assigned to a specific workgroup, so my intention is for each time a new workgroup is selected from the dropdown, the covermemo combo box in the subform becomes populated only with the covermemos associated with that workgroup. I'm almost finished except for the final step when I try to make the values regenerate...Access says that can't find the referenced form "sfrmSubmissionRecords"
This is the code that I'm using:
Private Sub cmbWorkgroup_AfterUpdate()
Forms![sfrmSubmissionRecords]![cmbCovermemo].Requery
End Sub
View 2 Replies
View Related
Mar 7, 2014
I have a form with subform (datasheet) .
On my subform i have one field which shows the
productId ( which is filtered from combo boxes on main form) .
productId contains two columns
1 bound column(id) ( hidden with width 0 )
2 column (desription) ( shown with width 2 )
Now after entering the data when i come back to the form again . It hides the data from the productId field on subform , because data in combo box (on main form) doesn't match. Although the row is showing up , only the text in field (productId) is hidden.
Now when i change data in combo box on main form to match the ProductId , then the productId field text shows again. after changing combo box it hides . What i need is the existing data should not hide when i change the combo box selection.
see pic 1 where product matches and pic 2 where not. please note i am using master child relationship on the form/subform.
View 14 Replies
View Related
May 6, 2013
I have faced with a problem while i was filtering my main form.....my problem is when i filter the main or parent form the related sub-form also gets filtered how to manage the main form so that when i filter it the sub-form should not be filtered so that i can get the related record to my filtered one in the sub-form... as for the time being when i filter the main form the related record in the sub-form is not shown and when i press unfiltered on the sub-form its data gets appeared....
View 11 Replies
View Related
May 30, 2013
I have these 3 combo boxes filtering results into a subform.
Code:
Private Sub Combo5_AfterUpdate()
If Len(Nz(Combo5, "")) > 0 Then
FindRFQsubform.Form.Filter = "[RFQ Title] = '" & Combo5 & "'"
FindRFQsubform.Form.FilterOn = True
[code]...
View 1 Replies
View Related
Jul 17, 2005
I have a main form with a subform. On my main form, I have a combo box set to "find a record on my subform, based on what I select in the combo box." This works great! At the same time, I want to use this main form combo box to synchronize with a combo box in the subform to display a value based upon the value selected in the main form's combo box. I have tried several things and searched Access newsgroups without success. I am using MS Access 2002, producing an Access 2000 database. Has anyone got any ideas? I could really use some help. Thank-You.
Denny G. :confused:
View 5 Replies
View Related
Apr 17, 2014
I am using MS Access 2010, I have three tables,
Policies (Id, Client Id, Address, Policy Amount, Paid)
Payments (Id, Client Id, Total Amount)
Payment Details (Payment Id, Policy Id, Paid Amount)
I have created a form "PAYMENTS" that include a sub form "PAYMENT DETAILS".
In the sub form control Policy Id is defined as combo box, and retrieving the list from Policies and Payments where Policies.Client=Payments.Client the query of Combo Box is as follows:
Code:
SELECT POLICIES.[POLICY ID]
FROM POLICIES
WHERE (((POLICIES.PAID)=False) AND ((POLICIES.CLIENT)=[Forms]![PAYMENTS]![ClientId]));
Only first time Combo Box display the Policy Ids according to the Client, but when I change the client and always displays the previous clients Policy Ids.
how to retrieve correct list of Policy Ids according to the Input Client in Payments.Client control
View 4 Replies
View Related
Mar 11, 2012
Let's assume we have 3 tables:
Order_Category (Order_Category_ID, Order_Type_Name) with 2 records:
1, Minor
2, Major
Order_Type (Order_Category_ID, Order_Type) with 4 records:
1, Book
1, Pencil
2, Car
2, House
Orders (Order_Category_ID, Order_Type, value) with 2 records:
1, NULL, NULL
1, NULL, NULL
2, NULL, NULL
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).
View 5 Replies
View Related
Jan 21, 2014
Im having trouble filtering a combobox on a form. I have two Comboboxes, one is called (FleaTickWorming) depending on what is elected in this cobo, will deside on what is available in the other combo which is called (Product). The form is a continuous form. The filtering works, in as far as it changes the list each time, but it also deletes the item that I have chosen on previous records if the list is different. My code is as follows:
Code:
Private Sub FleaTickWorming_BeforeUpdate(Cancel As Integer)
If Me.FleaTickWorming.Column(0) = 1 Then
Me.Product.RowSource = "qry_FleaProducts"
ElseIf Me.FleaTickWorming.Column(0) = 2 Then
[code]....
View 3 Replies
View Related
Jun 3, 2014
I am trying to select a value from one combo box and on the basis of this selection the other combo box show only those values which have link to the value I have selected.
View 14 Replies
View Related
Sep 12, 2006
Hi all
I have been using some code from this site to filter my forms and subforms via a selection of combo boxes. However, when I try to filter by either date or callid, I get runtime error 2001 and the debugger drops in at the first forms!filter line. This seems to work perfectly well for the other 3 combos that I use. Is it to do with the type of fields I am trying to filter with or am I missing something integral to the code? Each combo is named Filter1, Filter2, etc and the name of the field to filter by is placed in the tag line for the corresponding combo box.
Private Sub Command13_Click()
Dim strSQL As String, intCounter As Integer
' Build SQL String.
For intCounter = 1 To 5
If Me("Filter" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " _
& " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & _
" And "
End If
Next
If strSQL <> "" Then
' Strip Last " And ".
strSQL = Left(strSQL, (Len(strSQL) - 5))
' Set the Filter property.
forms!frmoutershell.frminnershell.Form.frminnerinn ershell.Form.Filter = strSQL
forms!frmoutershell.frminnershell.Form.frminnerinn ershell.Form.FilterOn = True
End If
forms!frmoutershell.frminnershell.Form.lblfilter.C aption = strSQL
End Sub
Any help would be appreciated as I am getting quite frustrated with it only working on certain parts of the form.
Regards
Jason
View 3 Replies
View Related
Jul 1, 2014
I thought I was in the home stretch of my project, everything worked great when I was messing with 200 records. Now that I'm messing with 2000+ records, things are very slow. So a search form redesign!
I have a form (frmSearch) that has a subform (frmSubSearch) embedded in it. The frmSubSearch is a datasheet only that is just pulling its info from a query (qrySearch). qrySearch has about 8 columns of data in it.
On the main form I have a combo box that is feeding its list from the qrySearch using a SELECT DISTINCT statement. So a user selects an item in the combo box and my After_Update fires. This sets a filter on frmSubSearch. I have three of these combo boxes that can add to the filter and they work great so far.
But I want to have the combo boxes filter themselves based on whats left on frmSubSearch. So if a user selects something in the 2nd combo box, the sub form filters and updates, but then I want the other two combo boxes to only have valid selections, and not something selectable that would wind up giving me a blank sub form result.
I have tried using .Requery in various ways, but its not working. I have also been looking into the idea of Cascading Comboboxes, but these don't seem to quite fit what I'm trying to do.
View 9 Replies
View Related
Mar 28, 2014
I'm an Access newbie and I'm having trouble restricting a combo box on a subform based on the selection of the combo box on the form.The combo box (Combo1) on the main form (FrmOrganisation) gives a list of companies, I want the combo box (Combo2) in the subform (SbFrmEmployees) to list people only from that company. I then have a subform within that subform that displays information about the employee.
View 3 Replies
View Related
Jul 2, 2013
I have a form that is bound to Table1 and I am using the value from a Combo box to filter the records. The Combo Box is populated with values from a different table.
The SetFilter macro is triggered using the AfterUpdate event. When the macro fires, Access asks for a parameter, so I know it's not getting what it needs to complete the macro action. When I provide a value, the macro works fine and returns the appropriate subset of records. I think the problem might be in the WHERE clause of the SetFilter statement; here is what I have.
[ComboBox value on Form]=[Table1]![Field]
Could it possibly be anything to do with using a different table to source the Combo box?
View 2 Replies
View Related
Jul 19, 2013
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]));
View 4 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
Sep 12, 2013
I have a form that filter records off of combo, I want the user to run reports based off of the filter selected in the combo box.Here's the code I've been toying around with:
Code:
Private Sub ReQuote_Click()
Dim strCustomer As String
Dim Filter As String
If IsNull(Me![cboFilter]) Then Exit Sub
[code]....
I ripped it off of another thread on here but my needs are slightly different so I couldn't quite get it to do what I wanted.
View 6 Replies
View Related
Jan 22, 2014
Is it possible to use Filter option in my form without using Query Wizard? - So that the user would be able to edit and change the other field on the same form
View 2 Replies
View Related
Jul 21, 2014
I have a form named frmMain that contains five buttons that lead to subforms, one of which is named frmDeceased.
In frmDeceased, I needed to create a combo box that relied on selections from the combo box before it. I was able to do this successfully in frmDeceased, but then today when I opened the database and opened frmMain, I realized that the query fails when frmDeceased is opened via frmMain. It works perfectly if I just open frmDeceased directly.
The first combo box is ROHE and the second is Iwi (which is dependent on the Rohe selected).
The query for Iwi has this criteria: Forms!frmDeceased!cbo_ROHE
When I open frmDeceased through frmMain, I get the 'enter parameter value' message showing "Forms!frmDeceased!cbo_ROHE".
I tried changing this query to: Forms!frmMain!frmDeceased!cbo_ROHE, but it didn't work.
View 14 Replies
View Related
Mar 24, 2014
I am using master/child form for data entry for packings and the details for this packings (i.e. the products inside a packing is entered in subform and packing master is entered in main form ).
In the detail subform i use a productId field which has look up from 1000 products , so i want to filter that particular combo box based on different types from product master ( from which it choses the products).
How many ways are there to filter that combo box based on different types ( which i have in product master as type,design,material etc).One way of which is combo boxes on main form.
[URL]
View 14 Replies
View Related
Jan 1, 2014
I have three comboboxes and I want to have the first one filter the second one and the filtered second one filter the third one.
Filtering the first one on the second one works, but when I whant to add a third one to it, it just shows blank spaces on the third one.
What I did to the first and the second combobox :
1: I pressed the second combobox.
2: Went to rowsource.
3: filled criteria in on the value i whant to connect the first combox to the second combobox ( [Forms]![Thetableimin].[1stcombobox].
4. requery the second combobox in programcode on the first combobox.
What I did to the second and the third combobox:
1: I pressed the third combobox.
2: Went to rowsource.
3: filled criteria in on the value i whant to connect the second combobox to the third combobox ( [Forms]![Thetableimin].[2ndcombobox]
4. requery the third combobox in programcode on the second combobox.
How do I make a third combobox that uses the filtered values of the second combobox to filter the third combobox.
View 7 Replies
View Related
Jul 5, 2006
I have a form that we are creating to issue project numbers. We have about 80 different clients. I have set up a combo box for the client name, where we can choose the client from the drop down menu. We want the form to filter according to the client name that you choose. For example, if you pick Lawrence as the client name, the next combo box is the project name and I want it to only show the project names that have been assigned to Lawrence in the past. Can someone please help me on how to do this and if it is even possible at all? Thank you so much for your help!! I have been wrestling with this for about a week and a half now.
View 1 Replies
View Related
Jul 26, 2006
Please help. My inability to achieve this is very frustrating.
I have a tabular form based on a query, which returns a large number of records. I need users to be able to filter the records to display data relating to what they have entered in a number of combo boxes.
For example I have fields showing Product ID, Manufacturer ID, Purchase Order number and due date. Each of these fields has a corresponding unbound combo box where users can select values that appear in the table. I need to be able to filter the form based on what is in these combo boxes. I.e. Filler for a product ID to show all purchase orders numbers and due dates relating to that product ID or filter for a manufacturer ID and due date to show all Product IDs and purchase orders relating to that a manufacturer and date.
Ideally this would be achieved by pressing a command button.
The query, table and combo boxes are all built and work fine but I am unable to get the filter to work, I am using Access 97 and am not very familiar with visual basic. Any help would be appreciated.
Thanks.
View 4 Replies
View Related
Sep 19, 2013
I'm attempting to filter my form with combo boxes. I've added the below code, but the if statement that checks if one of the combo boxes is null won't work. If the combo box is null or "", it's supposed to assign a wildcard to the variable. But it doesn't pass the test and goes straight to the Else statement. I've highlighted the if statement that keeps failing in red.
Code:
Private Sub btn_Search_Click()
'create variables to store the combo box values
Dim str_Country As String
Dim str_Vendor As String
Dim str_Survey As String
[Code] ....
View 4 Replies
View Related
Jan 5, 2014
I am using this code to filter a List Box based on a Date range and a Combo Box selection:
Code:
Private Sub Combo139_AfterUpdate()
Dim StrgSQL As String
StrgSQL = "SELECT [User Name], [Date Of Request], [Description of Problem], Status, Sub_Job FROM QRY_SearchAll " & _
"WHERE [Date of request] BETWEEN #" & CDate(Me.txtStartDate) & _
"# AND #" & CDate(Me.txtEndDate) & "#;"
StrgSQL = StrgSQL & " WHERE Sub_Job = Combo139"
Me.SearchResults.RowSource = StrgSQL
Me.SearchResults.Requery
End Sub
However, It is not working. when I click the Combo box the List Box comes up blank.
View 13 Replies
View Related
Mar 31, 2014
I have a form that currently uses a "catch all" table for listing available equipment to choose from for an equipment field. I call it tblEquipment. What I want to do is to make it so when I type a name in (1 of 35) in one field of the current record, the record source for the equipment field immediately looks at a different table that has equipment available only for that name. To do this I plan on making 35 different tables with limited data originally found in tblEquipment. I would call these tblEquipment1, tblEquipment2, etc. I do not use a sub form, nor do I want to.
So my questions are:
1) can this be done
2)If it can be done, how can I do it?
View 3 Replies
View Related