General :: Cascade Combo Boxes With Duplicate Values
Jan 18, 2013
I'm trying to Identify a particular entry in my table for editing via combo boxes. The same serial number will come in multiple times but a different job number each time it comes in. To identify a record for editing I need the user to identify the serial number in combo1 and then the job # in combo2 (cascaded combo boxes).
The issue I'm running into is that combo1 has dozens of serial number duplicates (combo2 is acting as it should). When I change some settings around I'm able to get combo1 to eliminate duplicates but now combo2 only shows 1 job # when there should be dozens for that serial #. I need all like serial numbers to show their job # in combo2 and I have not had any luck surfing around the net/forums/experimenting.
I'm pretty sure I have to use a Junction Table but I haven't messed with that and I'm not 100% sure that's the best/only way to do it.
How do I create Related Cascade Combo boxes by CD Group and Name of CD To only display the records from NAme of CD related to the CD Group
Or to to a ABC and click on Artist and then click on the list with Name of CD
Someone else is wonderinf a friend of mine in Acess you can create a inventory Database to display records related like Name of Furniture Brand, Item and Search ny Last Name to see if they bought that Item
I am trying to get a 2nd combo working from the first .
I have a table called Keystage (tblKeystage) and I have also named my 1st combo cboKeystage. then by following the vba below I created another 6 tables with corresponding names and combo's.
Private Sub cboKeystage_AfterUpdate()
On Error Resume Next
Select Case cboKeystage.Value Case "Foundation" cboYear.RowSource = "tblFoundation" Case "KS1" cboYear.RowSource = "tblKSOne" Case "KS2" cboYear.RowSource = "tblKSTwo" Case "KS3" cboYear.RowSource = "tblKSThree" Case "KS4" cboYear.RowSource = "tblKSFour" Case "Post16" cboYear.RowSource = "tblPost"
End Select
End Sub
The combo boxes both work, brilliant. My problem is that when I enter another record and make a selection from the 1st combo box, it changes all the records.
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...
And other time it wont work with On change but only with After Update Event (code is same).
Another thing this morning happens was that when I tried to add new record trough form where combo box and tex boxes are located, MS Office suddenly stopped working after selecting combo box selection (with message Microsoft Office has Stopped Working). It is 2013 version.
I got it work after deleting and re-inserting VBA code to autopopulate text box at After Update Event.
I am working on a database to track IT assets with third parties. I have a table called "Equipment" that includes info like model, serial numbers, purchase price, date, location, and "Asset ID". I have a second, single field table called "asset tag" that is just a list of asset ID tags, XYZ1000, XYZ1001, XYZ1002..
I created a one to one relationship between the two tables on the following fields: "equipment.assetID" and "asset tag.asset ID"
Once an "asset ID" is used, I would like it to either be grayed out or disappear from the list of available ID tags. Basically, I want it so that each "asset tag. Asset ID" can only be used once.
I just started using Access a couple weeks ago. I bought a couple books, have read some help stuff in forums webwide, but I am still stuck on the basics of how to do the following~ Please Help ~
My DB: I have a single main table, in addition there are several mini-tables used to support combo boxes for form inputing.
My Mission: It's been requested of me that My Main Switchboard have an option to lead to a secondary form where the end-user can "quick-filter" records to generate a table or report based upon dropdowns and check boxes for 9 different search variables- the data will then be pulled from the original data table based on the 9 choices (or less, as there will be often certain variables left blank).
My Questions: 1) how do I tie the values from the combo boxes in my new form to supportive queries? (perhaps a parameter query with a macro that searches that particular combo box for values??) - or is there a better way to do this? 2) how do I tie all those queries together so that some of the 9 choices can be blank, and of the others the assurance that they'll stack- or further refine the results. 3) one of the search criteria is Industry Sector. there is a mini-table to provide the values for the drop-down, but in the main table there are four columns in case a particular company falls into more than one sector. will this present any problem or can a query be easily tailored to search any of those four columns for that value?
I want to thank anyone who cares to help very much, in advance. I know my issues probably seem very simple, but I've been tasked this duty of learning Access and working the company's DB on my own. The "comprehensive" books that I've purchased haven't seemed to clarify this particular issue, so here I am. :o
I have a form that includes a field for the operating system of the client. I want this to be populated from a look-up table. I want the combo box to display the text name of the OS but enter the numerical ID number to the client table. How do I do this?
I have set up a nice timesheet form now with lots of help on this forum.
I have a form with a subform(1) which has another subform(2). The form is NOT in Data Entry mode, so users can select their name from the main form, the period from subform(1), and then enter/edit timesheet records in subform(2). In subform(2), I have some combo and text boxes for each record. The first is cboProjectSelect. Column(2) of the selection made in cboProjectSelect is entered into tboProject. Additionally, the selection made in cboProjectSelect filters another combo, cboWorkstream. The records are displayed in datasheet view (I know I've been advised against this, but I've had to do this, because the users want to see all records as they enter their timesheets)
All this work beautifully....for the first record. For some reason, when you enter any subsequent records, it blanks out the values in the tboProject and cboWorkstream boxes for all records! If you click in any of them, the correct value appears, if you click away, it disappears.
The proper records are being entered in the relevant queries and tables, so everything is working fine. It's just annoying that the boxes go blank!
Any idea if there is a way to ensure the values don't disappear?
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.
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).
tbl_Retainer tbl_Retainer_Grant_Funding tbl_Retainer has the field, Retainer_ID
And tbl_Retainer_Grant_Funding has the fields, Retainer_ID (a lookup field from tbl_Retainer) Agreement_Num (a lookup field from tbl_Grant)
I have a form based off of a query(not sure if that matters), that uses that tables, tbl_Assignment and tbl_Assignment_Grant_Funding. These tables have the above fields as lookup fields.
So...what happens is, if an Assignment has a Retainer, I want the Agreement_Num box to show only the Agreement_Num's associated with that Retainer, otherwise just show all the Agreement Num's.
In my form, I have Retainer_ID with the row source, SELECT tbl_RETAINER.Retainer_ID FROM tbl_RETAINER;
And Agreement_Num with the row source, SELECT [tbl_GRANT].Grant_ID, [tbl_GRANT].Agreement_Num FROM tbl_GRANT ORDER BY [Agreement_Num];
In my AfterUpdate event for Retainer_ID I have,
Private Sub Retainer_ID_AfterUpdate() Dim strSql As String strSql = "SELECT [Retainer_ID]," & _ "[Agreement_Num]," & _ "FROM tbl_RETAINER_GRANT_FUNDING" & _ "WHERE [Retainer_ID] = " & Me.Retainer_ID.Value
Me.Agreement_Num.RowSource = strSql Me.Agreement_Num.Requery End Sub
When I am in my form and choose a Retainer ID, the Agreement_Num box goes blank, and there are no choices to choose from. I am wondering if this is because the Agreement_Num's are sourced from tbl_Grant and not from tbl_Retainer_Grant_Funding.
I followed the Microsoft guide detailing how to set up two cascading combo boxes. I would like to add a third box to the cascade. I have tried making some assumptions based on the code in the example but I can't get it to work.
I have three queries set up; qryBusiness, qryBusinessUnit and qryLocation.
I am using one form; frmToolInfo.
I have three combo set up; cboBusiness, cboBusinessUnit and cboLocation.
I amended my code to the following:
Private Sub cboBusiness_AfterUpdate () Me!cboBusinessUnit.Requery Me!cboBusinessUnit.SetFocus End Sub
Private Sub cboBusinessUnit_AfterUpdate () Me!cboLocation.Requery Me!cboLocation.SetFocus End Sub
Private Sub Form Current () Me!cboBusinessUnit.Requery Me!cboLocation.Requery End Sub
I want to cascade down from Business, to Business Unit to Location.
Can anyone advise me as to what I've done wrong here.
I have a form named Welcome and would like to add two cascade combo boxes.
The first combo, named cbolist get's its data from a table named QUERIES which has three fields:
ID QUERYNAME QUERYDESCRIPTION
cbolist displays the records contained in the QUERYDESCRIPTION field which are basically the name of other tables of my database with different records (obviously).
I would like that after selecting a record in the cbolist, the second combo, which I will call cboresult, will populate with all the records of that specific table selected in the cbolist.
I've got a combo box that lists duplicates. I want the dupes removed.
I went to the Query Builder for my Combo Box and set Unique Values from "No" to "Yes" - Saved, then re-opened the form. It still lists dupes.
I went back into Query Builder and unchecked the box for the Patient_ID (Autonumber) field. I saved it, then viewed the Datasheet for the Query, and it correctly lists the data I want WITHOUT dupes.
However, when I go to Form View, the combo box lists several blank entries..
The entries come back when I re-enable the Autonumber field in the Query.
This is what I currently have...
SELECT DISTINCT Patients.FullName FROM Patients ORDER BY Patients.FullName;
I need directions on Cascade Combo Box, So when I select:
CD Group
Displays only the CD's in that Group that are related to that Name So what fields would I have to set up for CD Group and CD NAme with that Table. Someone emailed me an article on Cascade combo boxes what fields so I need for the coding.......
I am new ussing access already with issues surprice no.I have four tables Section, Ducument, Description, Origin.I nees to Synchronize four Combo boxes, my first combo box code work fine
Private Sub cboSection_AfterUpdate() Me.cboDocument.RowSource = "SELECT DocumentName FROM" & _ " [Document] WHERE SectionID = " & Me.cboSection & _ " ORDER BY DocumentName" Me.cboDocument.Enabled = True End Sub
When I select a category from my first combo box the secon combo box get populated with the correct Data.But when I select the second box the third combo does not get populated with any data here is my code for the second combo box.
Private Sub cboDocument_AfterUpdate() Me.cboDescription.RowSource = "SELECT DescriptionName FROM" & _ " [Description] WHERE DocumentID = " & Me.cboDocument & _ " ORDER BY DescriptionName"
What I am trying to do is, for example, I have 2 combo boxes, you can select a value in the first one and search and your results match the criteria, or you can select a value in the first AND second one and the records dispalyed will match the first AND second combo box criteria.
I am creating a small database for a budget and Im trying to create 3 cascading combo boxes on a form (areabox2 , devbox2, entitybox2) . I have it right now so that that
devbox2 is based on areabox2 and entitybox2 is based on devbox2 BUT!!!!!!! I want entitybox2 to be based on both areabox2 and devbox2
Parameters are :
Table = Budget Info areabox2 data = [Budget Info].[Project Area] devbox2 data = [Budget Info].Development entitybox2 data = [Budget Info].Entity
I have designed a main form which have buttons for about 30 different companies name to open, each button opens an individual company form. Now the companies list is growing day by day so i want to create a combo box which select the company name and open the relevant company's form.
Do I need to create a table which lists all the companies and then add a combo box on a main screen which select the company name and open the form but i need a VBA code for that.
I am currently developing a database to provide a friend with an auction tracking and ordering system.
I will have a number of questions the first is related to the Home Page/Dashboard/Summary form I am creating. I basically have a few sections, one of which is a combo box offering the user to select an auction to view in the summary section. This summary section contains the list of lots but I also hope to to expand on this and create multiple text boxes, each containing the answer to a number of queries (totals etc).
I have written all the queries and can see the results however as the form does not have a record source I would like to know how to make each text box populate with the result of different queries (ideally in vb - I am using ms access 2010)?
I have tried a few things, control source doesn't apply as I have no record source (i guess). I investigated Dlookup/Dcount but am unsure if these apply for the same reason. I understand I am likely to need a recordset etc in vb and have already tried a few things but unfortunately none of them work.
I have a table with the following 5 fields. (Service Type), (Valve Name),(Size),(Rating),(Description).
I want to do two thing:
First: I want to select the required information from the first 4 fields using combo boxes and get the last field (description) based on the selected 4 fields. In other words, i want the record to be filtered using first 4 fields to give me the last field info.
Second: I want to store the filtered record (all 5 fields) in another table.
I'm jumping to the forms development and going to try what I need via queries and SQL. I'm trying to do a series of cascading combo boxes which have worked out fine, right till I hit the first junction table.
I will include the VBA code below as well as a screenshot but here's how it goes.
REGION cascades down to COUNTRY cascades down to PORT and then to CARRIER.
This is for a shipping program.
When it gets to PORT and are trying to cascade to the various CARRIER's thats where it hits a junction table of PORT_CARRIER.
Here is REGION to COUNTRY:
Me.cboCountry.RowSource = "SELECT COUNTRY.CNTRY_ID, COUNTRY.COUNTRY FROM COUNTRY " & _ " WHERE REG_ID = " & Nz(Me.cboRegion) & _ " ORDER BY COUNTRY" Me.cboCountry = Null
COUNTRY to PORT :
Me.cboPort.RowSource = "SELECT PORT.PORT_ID, PORT.PORT FROM PORT " & _ " WHERE CNTRY_ID = " & Nz(Me.cboCountry) & _ " ORDER BY PORT" Me.cboPort = Null
PORT to CARRIER:
Me.cboCarrier.RowSource = "SELECT PORT_CARR.PORT_ID, PORT_CARR.CARR_ID FROM PORT_CARR " &_ " WHERE PORT_ID = " & Nz(Me.cboPort) & _ " ORDER BY CARR_ID" Me.cboCarrier = Null
PORT to CARRIER is where the problem is.
It populates the combo box, but with the ID numbers instead of actual CARRIER names.
(the Junction table are two PK fields and are lookups to PORT in PORT table and CARRIER in CARRIER table.)
Is there a magic spell for cascading combo boxes when you hit a junction table?
We are working on an Access (2007) database that is on a SharePoint Site (2007).
Currently the form is operational, but there is one last thing that would be nice to have.
The table is "Updated Headcount" which contains "EMP_ID" which are unique numbers stored as text.
In the event a new employee is entered in the system by another user on this site we would like to prevent any duplicate "EMPID"s from being entered and saved on the SharePoint, we would also like to alert the user and prevent the data from being saved.
All data is currently bound, so once the user makes a change it is made, no submit button is required.
We are running into some difficulties in doing a dlookup from the value entered and comparing to a column in the table.
TABLE - UPDATED HEADCOUNT COLUMN in UPDATED HEADCOUNT - EMPID FORM CELL user will input an EMPID - newEMPID FORM CELL used for a dlookup to compare what user has entered to what is already in the table - duplicateEMPID
So below is what we are trying to do, we are sure there are a few commands missing....