Combobox Depends On Input Of Other Combobox
Feb 25, 2008
Hey all,
I've read some tutorials on this sort of thing, but I can't seem to piece it all together to achieve what I want.
I have a table Products that contains the fields Product, Size and Brand. I also have a form, frmProducts, that has a combobox linked to each of the fields in the Products table. I want to be able to select a product from the first combobox, tab to the Brand combobox and have only those brands associated with the product already selected.
This is how I think it should work:
1.ComboBox1 selects productA
2.ComboBox2 takes its options from a query that searches Products table for all instances of productA and displays all available brands. brandA is selected.
3.ComboBox3 get its options from another query that searches for all instances of productA that also have brandA and displays all available sizes.
What I'm having trouble with in particular is passing the data between queries. For example, I can't figure out how to tell the query to search for all instances of productA when its defined by the first combobox. Do I have to store it as a variable somewhere?
I hope I've been clear.
View Replies
ADVERTISEMENT
Feb 27, 2014
I am trying to use a combobox to select a value which then activates a query to return results.
Here is some details
I have to tables, one called "Customers" and the other called "Calls". These two tables are linked.
The customers is literally a list of customers with their contact details, but all I am in interested in is the "Company" Field.
The Calls table has a field called "End User" which looks up the company from the Customers Table.
What I am trying to do is create a search by Customer query, furthermore, I would like to do is to create a form with a drop down that looks up from Customers table, select the company and it returns all the records with that company...
What I have done
I have created a query that has the customer and calls tables included, I have dragged down the [Company] from customer table and then all the fields from the Calls table.
Then i created a blank form, inserted a combobox - Combo7, linked the box to the Customers table.
Back to the query, under the [Company] I have put into the criteria the following
Forms!sc!Combo7
Back to the form, selected the combo box, built a macro in the AfterUpdate, to run the query.
Tested this and it does not bring anything back, however if I put into the criteria Like [Please Enter Company Name], then typed the company name, it brings back all the records for that customer.
Am I missing something?, do I need to set the form control to the query, or even the combobox....
View 1 Replies
View Related
Apr 10, 2008
Please could somebody point me in the right direction of code.
I have a database which I would like to query using a form with a combobox or two, each of which containing a list of eg. Customer Names, or Reference Numbers, which will then produce a report which can be printed out.
I know basic ADO, like get the database, open it, find records, update and delete records, however I have been unsuccesfully searching for the code to open a report, which will respond to certain sql parameters that correspond with the values in the combobox. And then be able to print that report if possible.
I would be much appreciative if anyone would point me in the right direction,
Thanks!!
View 2 Replies
View Related
Jan 24, 2015
I try to validate the input in a form combobox. In my table it works okay with a validation rule
validation rule: Like "[A][B]"
validation text: The input should be two numbers with A or B with two numbers Example: 01A01 or 21B43
But when i go to my form i can still input other letters than A or B. It will not save but there is no warning that the input is wrong.
View 4 Replies
View Related
Apr 26, 2015
I am trying to use a combobox called Manufacturer to select which table the combobox called Model gets it's rowsource from using the code below.
Code:
Private Sub Manufacturer_AfterUpdate()
If (Me.Manufacturer.Value = "Siemens") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SeimensTable"
Me.Model.RowSource = "SELECT Model FROM SeimensTable"
Else
If (Me.Manufacturer.Value = "Samsung") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SamsungTable"
Me.Model.RowSource = "SELECT Model FROM SamsungTable"
End If
End If
End Sub
But when I run the form and select Manufacturer. Combobox Model remains empty. tell me what I'm doing wrong?
View 5 Replies
View Related
Jan 13, 2005
How would I modify multiple comboboxes in subforms at the same time. For example.. In main form ComboboxA user selects 1992, Combobox1 in subform1 is also changed to 1992, as well as Combobox2 in subform 2.
Whats the best way to do this?
View 2 Replies
View Related
Apr 22, 2005
I have 2 comboboxes, the first one is called "activity", whereby I have 3 options to choose from, and the second is called "level".
When I click an "activity", for example Drawings, I want the "level" combobox to list a unique set of options for that category. and if I click on a different "activity" for example Planning, I want the "level" combobox to show a completely different set of options.
If anyone can give me any help on how to do this then I would be very grateful!!
Thanks
Angela :eek:
View 2 Replies
View Related
Jan 25, 2006
I've tried searching the forums and haven't found quite what i'm looking for. I would like to be able to change the source for a combobox based on another combobox. The simplest way i can summarize that is i want to be able to choose A or B, depending on my choice i want another combobox to display all the values that A or B can have.
Thanks
Jim
I'm not sure I worded that very well. :(
View 1 Replies
View Related
Jun 6, 2005
If I want the combo box to read entry's from one table and then store in another table how would this be done? I think it has to be done with the query builder but I am not sure. I am sorta new to Access.
View 2 Replies
View Related
Dec 8, 2006
Hello,
I have an invoice form with its detail subform that I have been stuck with for a while. The main problem is on the detail subform, here is what I have:
1. I have 5 fields, DepartmentID, ProductID, Qty, Price, Total.
2. The department is a combobox and I want to select the department that the product is from. Example: If I will be selling a pvc pipe I should select PVC Department.
3. Once I select the department I want the product combobox to only show the products from that department. So I select Electrical Department I can only see what items belong to the Electrical Department.
That is basicaly what I need it to do. So, I worked hard on this looked at samples, read threathds, pull all my hair out, almost done eating all my nails, and most of you know how that goes!!!!
Well finaly after sleepless nights I got something to work!!! I was able to make the product combobox only show the items from that department, Man I was jumping of joy!!! I turnon my radio and put on "Eye of the tiger" and started boxing away!!!! jejeje
Well, I started to make it look pretty, changing the looks and changing the comboboxes to show me the name of the department not the ID, worked good, than I changed the product combobox to show the name not the ID and something went wrong......
The department combobox does a requery of the product combobox everytime I select the department for a new item. So for some reason it makes the product code from the other item disapear....I cant figure it out!!
I have attached the DB, goto frmFactura there is already one invoice started, I have selected the PVC Dept and the Product, you can also see the prtoduct code, once you goto the next item and select another department the prodcode desapears but the prodid stays...
CAN YOU HELP ME PLEASE!!!!!
View 3 Replies
View Related
Jan 22, 2008
Hallo,
Simple question, is their a way of showing the value on the combo box without saving it in a table. Therefore, when you open the form again next time the value last selected is viewed again.
Thanks
View 1 Replies
View Related
Mar 8, 2005
On a form i have 25 comboboxes with names the form is based on a table (tblpersons) with the key personID now how can i in all the comboboxes in the event before update
doing the following:
when i select a name in a combobox before update i want to search in all the combobowes of that name i selected not 2x selected is and and if not then the name must in the field otherwise it would tell me that thr name al is selected in another combobox. If the name i selected is ok then this name must not again availible in the combobox
can someone help me with that code please?
Is this with a loop?
View 4 Replies
View Related
Apr 18, 2005
I want to have a combobox draw its information from more then one column in the same row from the table, but show as only one column when a user clicks on the combobox in the form.
Example of what I am doing...
Table with contact information:
Contact, Phone1, Phone2, Phone3
Combobox on form for contact log: (what I want but not sure how to do)
Phone = (Phone1, Phone2, Phone3 in a single column)
I need the combobox to be able to select each phone number seperatly from that contact so I can show which number was called.
View 4 Replies
View Related
Jun 12, 2005
I know there have been old threads on this issue. I have done a search and read them. That is how I got this far. I was able to search the Web, find a Govt site with a list of every zipcode in the country. It was a text file so I converted it in excel and then imported into an Access table. I now have a 4 field table with every zip in the country-city,state,and Zipplus a auto number field as my primary key. My db is name and address intensive in multiple tables. I want to use a combobox to lookup and display city,state and zip on my forms from this table instead of storing the information. However, If I do this and then want to generate a mailing list how can I do this if the city,state,zip info has only been displayed from a combobox and not stored in the underlying table? Since I am using an autonumber as the primary key for the city,state,zip table can I include a field for that pk in an invisible field and just store that? If anyone wants the table of zipcodes let me know. I'll be happy to upload it.
View 1 Replies
View Related
Aug 5, 2005
I have a form for entering data. I use a combo box linked to a table to select a record that has a person's SSN, Name and city. Once the proper record is highligted and selected only the first column is visible in the combobox. Is there any way to keep all 3 columns visible once a record is selected in the combobox?
View 1 Replies
View Related
Jul 14, 2013
When i try to update a field using a lookup instead of giving me the name of the employee and Customer it only offers their respective ID numbers. How can i change this?
View 1 Replies
View Related
Apr 17, 2006
I've been searching these forums but couldn't find what I'm looking for. Here's what I need - maybe I'm going about it the wrong way.
I have a table called Customers. For each customer (custid) there can be multiple contacts - contact1, contact2, etc. each with their own phone, e-mail, etc.
I have a form called New Job - when I enter a new job and select the customer - I would like to have a drop down box of the available contacts for that customer (based on custid). Everything I've seen so far only allows me to have a drop down from the same field - not multiple contact fields.
Any thoughts?
Thanks!!!!
View 3 Replies
View Related
Apr 23, 2006
i searched for similar combobox features, nut didn't find any that helped.
i have 2 unbound combos that get heir values from different tables
first combo1 gets its values from a query
SELECT [tbl_music].[MID], [tbl_music].[Artist], [tbl_music].[Song], [tbl_music].[CID] FROM tbl_music;
combo2 gets values from
SELECT [tbl_category].[CID], [tbl_category].[Category] FROM tbl_category;
IDs are autonumber and primary
The CID fields in the tables are in a 1..* relationship
Both are constructed with the wizard and the ID columns are hidden.
What i need is:
when selecting something from combo1, the combo 2 should show the right category for that song.
Hope i explained clearly enough.
I tried to use the dlookup function, but i get error 94, invalid use of null.
i'm using the afterupdate event.
I can update a textbox text, but can't do so with the combobox value.
Any ideas what i'm donig wrong :confused: :confused: :confused:
View 10 Replies
View Related
Jun 15, 2005
Hi I really have a problem in MS access.
I created a combo box which as 2 columns, eg Plant ID and Plant name
I need to have the Plant ID on the left and Plant Name on the right which it is at them moment, however....
When I choose an option inthe combo box, it will display the Plant ID number in the textbox because it is on left (its the 1st column in the drop down box)
.... I want it to show the plant name instead, but still have the plant id colun on the left and plant name onthe right when i click the arrow of the drop down box,
sry if its confusing, i need an anwser ASAP, thanks!
View 1 Replies
View Related
Jul 13, 2005
I've seen comboboxes before that by typing the first letter of the word your looking for it will go to the first word matching that letter, but then by typing that letter again it will go to the next word starting with that letter:
Such as in a "Choose Your State" box by typing "M" it selects Massachusetts then by typing m again it selects Maryland, the third time it selects Maine... and so on. I would like to add this to a cbobox on a form but havent had any luck. I have searched the forum but didnt find anything pertaining to this. Any help or suggestions on where to get this info is greatly appreciated.
JO
View 1 Replies
View Related
Oct 19, 2005
hi, i'm a newbie, i've got a question about combobox:
i've a form "Order" and a subform "suborder" with a combobox based on a table "Object" with this value: ID, Object, Price, Category. When i choose a value, the combobox returns to the "suborder" table ID value...now, is possible to returns also the others value to that table??
Please answer me....sorry for my bad english i'm italian
Thanks early!!!
View 2 Replies
View Related
Oct 19, 2005
hi, i'm a newbie, i've got a question about combobox:
i've a form "Order" and a subform "suborder" with a combobox based on a table "Object" with this value: ID, Object, Price, Category. When i choose a value, the combobox returns to the "suborder" table ID value...now, is possible to returns also the other values to that table??
Please answer me....sorry for my bad english i'm italian
Thanks early!!!
View 1 Replies
View Related
Jan 15, 2008
I don´t get this effect: I am struggling with a cascading combobox problem, could you help me, please?
form is frm_Principal. Combobox are Categoria, 2ª Categoria and 3ª Categoria. Where´s the error?
http://www.drupload.com/uploads/211DB_MM08.rar
thanx so much
View 4 Replies
View Related
Jan 21, 2008
Hi,
i have placed a combo box on my form using the wizard. the form is based on a table which is related to a query to reduce the amount of entries. when i scroll through the records, i only see the correct numbers based on the event however, when i add the combo box, it shows ALL entriesin the table instead of the ones i can scroll through. the numbers seen are-
1,7,9,10,23,24,28,29,32,33,38, these are all payment numbers based on a name. the combo box shows all payment numbers 1,2,3,4,5,6,7,8,9,10 an so on. can this be altered to show only the available record numbers?
the payment number is also the primary id number for that table.
many thanks,
Nigel
View 4 Replies
View Related
Feb 7, 2008
Hi guys I know how to count a listbox value, but how can I count a combobox, I'm trying to count the results in the combobox. for example if the comobobox has three itmes in it how can I count them in a textbox?Thanks.
View 1 Replies
View Related
Mar 13, 2008
Hello Everyone,
I wanted to know how I can set a default value into the combo box. The value I type in the Default value box doesn't seem to work.
Here's what i want to accomplish.
My default value should be my computer user id
=Environ("UserName")
How can I do this?
Thanks,
View 3 Replies
View Related