D
Dirk R
Access 2000
Form / Subform
I am currently working on a project where the parent form (master)
enjoys a one-to-many relationship with the detail subform (child). An
ID field links them.
The subform is continuous and displays about six fields. These fields
are largely bound drop-down combo boxes that allow the user to choose
the values (it is limited to the list). But here's the catch: Based on
the value he or she chooses from DropDown1 it will populate the
dropdown fields in DropDown2 and DropDown3.
For example:
DropDownA contains a list of automobile manufactures.
DropDownA
---------
1. Ford
2. Dodge
3. BMW
4. Porche
Based on the selection of the user, it populates DropDownB, which
contains a list of models, and DropDownC, which contains
manufacturer-based financing plans. In this case, the user selects
"Ford". Thus the DropDownB would look like:
DropDownB
---------
1. Mustang
2. Thunderbird
3. Focus
4. Explorer
5. Taurus
DropDownC includes a list of financing options offered by each company
that are tied ONLY to the manufacturer (DropDownA value)
DropDownC
---------
1. Ford Small business financing
2. Ford First-time buyer financing
3. Ford College student incentive
4. Ford dealer direct
5. Ford Corporate account division
There are a number of other fields, but they are not pertinent to the
challenge at hand. Basically the continuous subform contains multiple
rows of this data. If the user decides to change the value in
DropDownA it will automatically re-populate DropDownB and DropDownC
while setting the value of each to Null (thus indicating the need to
choose new values for each) while leaving the remaining row fields
alone. This work perfectly.
However, it does pose one small challenge: data validation. Once the
user changes the selection of DropDownA and thus resets the value of
DropDownB and DropDownC to null, we do not want the user to close the
form (or exit the database) without first making his or her selection
from DropDownB and DropDownC. Every record must have these values
(this is database common sense).
In the table I have tried making "Required" the fields to which the
DropDowns are bound, but this spits back an error each time DropDownB
or DropDownC is reset, since you cannot have a Required field set to
Null.
What would be preferable is to find a method that by clicking a button
(or closing the form) it would automatically "validate" the data on
the subform based on rules either (1) specified in VBA or (2) as
specified by the validation rule on the field of the subform itself. I
realize that this tricky and complicated. I have tried several
procedures, but I am having difficulty finding the "fool proof"
solution.
Thanks for your time,
Dirk
Form / Subform
I am currently working on a project where the parent form (master)
enjoys a one-to-many relationship with the detail subform (child). An
ID field links them.
The subform is continuous and displays about six fields. These fields
are largely bound drop-down combo boxes that allow the user to choose
the values (it is limited to the list). But here's the catch: Based on
the value he or she chooses from DropDown1 it will populate the
dropdown fields in DropDown2 and DropDown3.
For example:
DropDownA contains a list of automobile manufactures.
DropDownA
---------
1. Ford
2. Dodge
3. BMW
4. Porche
Based on the selection of the user, it populates DropDownB, which
contains a list of models, and DropDownC, which contains
manufacturer-based financing plans. In this case, the user selects
"Ford". Thus the DropDownB would look like:
DropDownB
---------
1. Mustang
2. Thunderbird
3. Focus
4. Explorer
5. Taurus
DropDownC includes a list of financing options offered by each company
that are tied ONLY to the manufacturer (DropDownA value)
DropDownC
---------
1. Ford Small business financing
2. Ford First-time buyer financing
3. Ford College student incentive
4. Ford dealer direct
5. Ford Corporate account division
There are a number of other fields, but they are not pertinent to the
challenge at hand. Basically the continuous subform contains multiple
rows of this data. If the user decides to change the value in
DropDownA it will automatically re-populate DropDownB and DropDownC
while setting the value of each to Null (thus indicating the need to
choose new values for each) while leaving the remaining row fields
alone. This work perfectly.
However, it does pose one small challenge: data validation. Once the
user changes the selection of DropDownA and thus resets the value of
DropDownB and DropDownC to null, we do not want the user to close the
form (or exit the database) without first making his or her selection
from DropDownB and DropDownC. Every record must have these values
(this is database common sense).
In the table I have tried making "Required" the fields to which the
DropDowns are bound, but this spits back an error each time DropDownB
or DropDownC is reset, since you cannot have a Required field set to
Null.
What would be preferable is to find a method that by clicking a button
(or closing the form) it would automatically "validate" the data on
the subform based on rules either (1) specified in VBA or (2) as
specified by the validation rule on the field of the subform itself. I
realize that this tricky and complicated. I have tried several
procedures, but I am having difficulty finding the "fool proof"
solution.
Thanks for your time,
Dirk