473,503 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cascading ComboBox I Just Cant Do that!

9 New Member
This is driving me mad!

I have been trying for 3 days now to work out how to do this with no success.

I have a SubForm in DataSheet View.

And a Table of "Products".
1. ProductID
2. Type
3. SubType
4. Weight (Only 1 option for each SubType)(need to fill auto)

the table look like this:
Expand|Select|Wrap|Line Numbers
  1. ProductID|Type|Subtype|Weight
  2. ----1-----Iron--Steel----5
  3. ----2-----Iron--Wood-----6.7
  4. ----3-----Gold--Dark-----55
  5.  
  6.  
In the SubForm i have this 4 as Combobox.

i want to do this:

Pick Type
and then the Subtype will requry depends on the type i choose
and after i choose the subtype the Weight and the ProudctID will Fill in Auto.

please help me.
Jan 27 '17 #1
7 1048
PhilOfWalton
1,430 Recognized Expert Top Contributor
I don't think you can the way your data is set out.

What you can do is build a form filter.
So create 2 combo boxed in the foot of the subform (I would personally use a continuous subform rather than a datasheet) with both single columns, one bound to Type and the other to SubType.

The rowsource for the first combo (Combo1) would be something like
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT [Type] FROM Products ORDER BY [Type]
  2.  
The second Combo would be something like
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT [SubType] FROM Products 
  2. WHERE SubType = " & Chr$(34) & Combo1 & Chr%(34)
  3. ORDER BY [SubType]
  4.  
On the AfterUpdate of Combo1 you need to do
Expand|Select|Wrap|Line Numbers
  1. Combo2.Requery
  2.  
Then build your form filter

Phil
Jan 27 '17 #2
snirben
9 New Member
ok lets remove the ProductID

i have just
1. Type
2. SubType
3. Weight (Only 1 option for each SubType)(need to fill auto)

can it be done with one table?
Jan 28 '17 #3
PhilOfWalton
1,430 Recognized Expert Top Contributor
Can I suggest that you tell us what you are trying to achieve. I know it's hard, but forget what you've got so far, let's have a bit of information on the purpose of your Db.

Anything can be done!!

Phil
Jan 28 '17 #4
snirben
9 New Member
ok, i will try to explain,
I build in access DB to my parent company,
its Steel Company.
my tables are(Not Full but the importent stuff is in):
TblProudcts
Expand|Select|Wrap|Line Numbers
  1. ProductID|Type|Subtype|Weight
  2. ----1-----Iron--Steel----5
  3. ----2-----Iron--Wood-----6.7
  4. ----3-----Gold--Dark-----55
  5.  
TblCustomer
Expand|Select|Wrap|Line Numbers
  1. CustomerID|Name|-------Phone|
  2. ----1------Moshe LTD---54545
  3. ----2------Iron LTD---45455
  4. ----3------Gold LTD---45454
  5.  
TblSuppliers
Expand|Select|Wrap|Line Numbers
  1. SupplierID|Name|----Phone|
  2. ----1------NY LTD---54545
  3. ----2------Ir LTD---45455
  4. ----3------Go LTD---45454
  5.  
Tblproject
Expand|Select|Wrap|Line Numbers
  1. ProjectID---ProjectName---CustomerID(FK)-----DateStart-----DateEnd
  2. ---3000-----Wall of steel-----2-------------28/01/2017--31/01/2017
  3. ---3001-----Iron Sky----------3-------------29/01/2017--31/02/2019
  4.  
TblBID
Expand|Select|Wrap|Line Numbers
  1. --BidID--SupplierID(FK)--ProjectID(FK)------Date--
  2. --1200------4---------------3000-------28/01/2017
  3.  
TblBidDetails
Expand|Select|Wrap|Line Numbers
  1. --BiddetailsID--BidID(FK)--ProductID(FK)--Quantity--Weight--Price
  2. -------1--------1200--------1--------------3---------5-------5$--
  3. -------2--------1200--------37-------------5---------35------10$-
TblOrder
Expand|Select|Wrap|Line Numbers
  1. --OrderID--SupplierID(FK)--ProjectID(FK)------Date---BidID(Linked)
  2. --4700--------4----------------3000-------28/01/2017--1200--------

TblOrderDetails
Expand|Select|Wrap|Line Numbers
  1. orderdetailsID--OrderID(FK)-ProductID(FK)--Quantity--Weight-Price
  2. -------1--------4700--------1--------------3---------5-------5$--
  3. -------2--------4700--------37-------------5---------35------10$-

TblCerM-When i Recive the order i need to create shipping certificate
Expand|Select|Wrap|Line Numbers
  1. --CerMID--SupplierID(FK)--ProjectID(FK)-----Date---OrderID(Linked)
  2. --9700--------4----------------3000-----28/01/2017--4700--------
TblCermDetails
Expand|Select|Wrap|Line Numbers
  1. CermdetailsID--CermID(FK)-ProductID(FK)--Quantity--Weight-Price
  2. -------1--------9700--------1--------------3---------5-------5$--
  3. -------2--------9700--------37-------------5---------35------10$-
TblInvoice
Expand|Select|Wrap|Line Numbers
  1. --InvoiceID---Date-------Total-
  2. --13000-------28/01/2017--5870$
  3.  
TblInvoiceDetails
Expand|Select|Wrap|Line Numbers
  1. --InvoiceDetailsID--CermID-OrderID--Total.
  2. -------------1------9700---4700-----50$

So this is how thay work:

Thay Create a project, Give it a name.
now thay need to Order Products from suppliers so thay make a
Bid and enter the Proudcts thay need. after that thay send the bid to the suplier and get back the supplier Bid to the items they ask with prices.
now thay create in Order thay "Link the Bid to the order" and all the items that in the bid Auto insert into the order Form.
Thay Create the order and send it to the suplier, now thay will recive the Proudcts in parts. 30% of the order and the rest is 70% of the order will arrive the day after or so.
they recive it with a CerM Doucment.
now thay go to the Project and open a new CerM, thay link the order to the Cerm and all the items that in the Order Auto insert into the Cerm Form.
But.. only 30% of the order is arrive. so i need to make in option to change the CerM, and he will know that.
now when i open a new Cerm and link the Order he will show me only the 70% Left.

after that in the end of the mounth i create invoice

in the invoice i can add CerM and Orders
when i add Cerm he will know that 3 more Cerm is linked to the Same Order as the first Cerm. and he will ask me if i want to add the rest of the Cerm, and if i have order with lets say 30% with out CerM he will tell me that Order didnt arrive Complletly do you want to Procced?

lets start with that i think its inaf.

by the why i need the proudcts to add as a casacde combobox, i pick type and then pick subtype(Filterdform the type) and then he will add the Weight Auto.

Thank you!
Jan 28 '17 #5
PhilOfWalton
1,430 Recognized Expert Top Contributor
Sorry for the delay in replying.

I think there are 2 options.
The simple one is to have a single combo box showing both Type & SubType which will give you your weight.
As a combo will only show the first value, I put text boxes over it with exactly the same formatting bound to the different columns. Th combo box is sent to the back

Here is an illustration,



On the final design the DDECo & DDErrorDescription are moved exactly over the Combo box.

The second alternative is to split your product table into
Expand|Select|Wrap|Line Numbers
  1. ProductID        1
  2. Product Type     Iron
  3.  
and a Second Table of SubTypes
Expand|Select|Wrap|Line Numbers
  1. SubTypeID        1
  2. SubType          Steel
  3. ProductID        Foreign Key
  4. Weight           5
  5.  
Then use cascading combo boxes.

Phil
Jan 29 '17 #6
snirben
9 New Member
I didn't understood the First One so well, my view is Datasheet,
I will try the second one,
but I don't need any vba code? to requry the combo box?

so I need a table of Proudcat ID with a list of the types
and a Subtype Table With Proudcat ID (FK)?

and you have idea about that: how can I make it happen? and lead?
"
in the invoice i can add CerM and Orders
when i add Cerm he will know that 3 more Cerm is linked to the Same Order as the first Cerm. and he will ask me if i want to add the rest of the Cerm, and if i have order with lets say 30% with out CerM he will tell me that Order didnt arrive Complletly do you want to Procced?"
Jan 29 '17 #7
PhilOfWalton
1,430 Recognized Expert Top Contributor
So the RowSource for the first Combo (CboProductType) is
Expand|Select|Wrap|Line Numbers
  1. "SELECT ProductType, ProductID FROM TblProducts ORDER BY ProductType;"
  2.  
So the RowSource for the second Combo (CboSubType) is
Expand|Select|Wrap|Line Numbers
  1. "SELECT SubType, SubTypeID FROM TblSubTypes WHERE ProductID = " & CboProductType & " ORDER BY SubType;"
  2.  
Then on the AfterUpdate of CboProductType you need
Expand|Select|Wrap|Line Numbers
  1. Me.CboSubType.Requery
  2.  
Hope that helps. It's difficult to be sure without seeing the database exactly what the problems are

Phil
Jan 30 '17 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
1418
by: Mike Fellows | last post by:
Below is my code that is carried out on my dataset, datagrid etc... Im trying to get column0 "Date & Time" to show date and time, not just date ive read some stuff posted by Dmitriy Lapshin on...
4
7809
by: pmcguire | last post by:
I have 2 bound ComboBoxes. I want the datasource of the second to be limited by the selection made in the first. I can do this by responding to the SelectionIndexChanged event on the first, but...
3
1918
H0kage
by: H0kage | last post by:
Hello everyone got an assignment for college where i cant find the way to make JDeveloper to understand where the words are separated.This What The Assignment Asks.Any Tip or example to help me...
10
2699
by: ZaphodBBB | last post by:
HI I have a form with 2 comboBoxes. The first comboBox gives me a list of customers to select from. I would like to have the second comboBox populated with the names of Departments. I only want...
19
2299
by: Amanduh | last post by:
Hi again, brilliant developers. I'm having serious issues with cascading comboboxes. I had it working perfectly before, but then was asked to add an additional variable and everything went haywire...
3
2295
by: Big P | last post by:
I need to make a combobox as dropdownlist that stays white. the combobox becomes gray or silver when i change it as dropdownlist. My question is: How to keep the combobox as dropdownlist in the...
6
1992
by: Luke PW | last post by:
All, I am having some difficulty with a cascading list box, which doesn't seem to be co-operating. I don't do much in Access - so forgive my ignorance. For info I am using Access 2003 I...
4
1489
by: tripti agarwal | last post by:
Cascading in c programming that is the increment operators #include<stdio.h> #include<conio.h> void main() { int i=1; printf("%d%d%d%d",i++,++i,i++,++i); getch();
1
1027
by: jdusn1978 | last post by:
What is the best way for the main form combo box to bring up the correct sub-form of the 19 available? The main form has a combo box called which has the options of selecting Category 1-19. When...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4688
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.