Let me Explain.
I have proudcts ,
I want to add proudcts by Combobox.
so first i want the user to pick Catagory and then MainType And then SubType and then Weight.
Catagory
MainType
SubType
Weight
So i devide my Proudct into 3 Tables
Lets say Catagory=Parit.
tblParit
Expand|Select|Wrap|Line Numbers
- ParitID|Parit
- ---1---|-Gold-
- ---2---|-Iron-
TblMaintype
Expand|Select|Wrap|Line Numbers
- MainTypeID|--MainType---|ParitID
- ----1-----|-Gold Sword--|--1----
- ----2-----|-Gold Hand---|--1----
- ----3-----|-Iron Door---|--2----
TblSubType
Expand|Select|Wrap|Line Numbers
- SubtypeID|SubType|Weight-|MainTypeID
- ----1----|-Long--|--33---|---1-----
- ----2----|-Short-|--45---|---1-----
- ----3----|--Half-|--67---|---2-----
- ----4----|-Finger|--32---|---2-----
- ----5----|-All---|--11---|---2-----
- ----6----|-Blue--|--88---|---3-----
Inside i have a sub form.
inside the subfrom i put 4 Combobox
1. CboParit
Expand|Select|Wrap|Line Numbers
- SELECT TblParit.ParitID, TblParit.[parit] FROM TblParit GROUP BY TblParit.ParitID, TblParit.[parit];
Expand|Select|Wrap|Line Numbers
- Me.CboMainType.Requery
- Me.CboMainType = Me.CboMainType.Column(0, 0)
- Me.CboMainType.SetFocus
- Me.CboMainType.Dropdow
2. CboMainType
SELECT TblMainType.MainTypeID, TblMainType.MainType FROM TblMainType GROUP BY TblMainType.MainTypeID, TblMainType.MainType, TblMainType.ParitID HAVING (((TblMainType.ParitID)=[Form]![Cboparit])) ORDER BY TblMainType.MainType;
With AfterUpdate:
Expand|Select|Wrap|Line Numbers
- Me.CboSubType.Requery
- Me.CboSubType = Me.CboSubType.Column(0, 0)
- Me.CboSubType.SetFocus
- Me.CboSubType.Dropdown
SameIdea
4. CboWeight
SameIdea
the subform is Datasheet.
My problem is when i choose new record it requery all of the recoreds and all vaules are gone.
Gif For Exemple: