> This is my table structure.
>
[quoted text clipped - 56 lines]
>>> with
>>> the subform value as a default value.
Flange type is directly related to pipe spec thus the flange table.
The bolts are directly related to the pipe size. (size, quantity and flange
to flange length)
The only variable is length. The user only has to select pipe spec and size
and the rest of the information is in my table. The only reason the length
changes - is if the connection is not flange to flange, but the diameter or
quantity do not change.
Basically I am trying to populate the bolt length field in my Bolt Gasket
Takeoff table using flange to flange length as a default or user entered
length from a list or custom value.
>Dan,
>Checking that I'm understanding your setup.
>The bolt length on the main form can either be from the list of
>FlangetoFlangeBoltLength in tblBoltMaterials
.
>Jeanette Cunningham
>
[quoted text clipped - 3 lines]
>>>> with
>>>> the subform value as a default value.
Jeanette Cunningham - 02 Feb 2008 22:09 GMT
Do you have one combo for pipe spec, one combo for size and a combo for
length?
If you want to use flange to flange length as a default, it needs to be in a
combo on the main form.
If user indicates that it is flange to flange, then you set the combo's
rowsource to a lookup table with flange to flange lengths (set as default),
if not, then you set the combo's rowsource to the other list. If the user
wants to type in a value, provide a textbox - as it appears you don't want
to add this length to any existing list of lengths. Make sure that a user
can either select from the combo or type in the textbox - but they can't do
both.
Jeanette Cunningham
> Flange type is directly related to pipe spec thus the flange table.
> The bolts are directly related to the pipe size. (size, quantity and
[quoted text clipped - 17 lines]
>>The bolt length on the main form can either be from the list of
>>FlangetoFlangeBoltLength in tblBoltMaterials
dancox - 02 Feb 2008 22:10 GMT
the only reason I am displaying the subform information is so the user can
see the result of there pipe spec or size selection. They will not alter the
subform information.>The bolts are directly related to the pipe size.
Jeanette Cunningham - 02 Feb 2008 22:18 GMT
I still suggest that pipe spec and size selection are done from combos on
the main form. If you want to show the related info on a subform after the
user selects from the combo on the main form, that's fine.
I still suggest the arrangement in my last reply for length - the length is
recorded directly in the main form.
Is there something I am missing?
Jeanette Cunningham
> the only reason I am displaying the subform information is so the user can
> see the result of there pipe spec or size selection. They will not alter
> the
> subform information.>The bolts are directly related to the pipe size.
dancox - 02 Feb 2008 22:46 GMT
Your not missing anything. I have never been able to make the default value
for the length combo box be the flange to flange length. I still need a
check box or some other way for the user to say the connection is flange to
flange yes or no. Based on that result, they will either get the flange to
flange length or direction to enter a custom value for length.
>I still suggest that pipe spec and size selection are done from combos on
>the main form. If you want to show the related info on a subform after the
[quoted text clipped - 9 lines]
>> the
>> subform information.>The bolts are directly related to the pipe size.
Jeanette Cunningham - 02 Feb 2008 23:14 GMT
You can set the rowsource for the length combo box to a query that shows the
selection of possible flange to flange lengths.
When user selects a pipe spec and size, does that impact on the possible
choices for flange to flange lengths?, if this is the case, we can change
the row source of the length combo to do this. What do you want to show for
the default value for the length combo?
Yes could use a checkbox and make both the combo and textbox disabled until
the user checks which length type they want.
Sometimes I do this sort of thing by putting both the combo and the text box
near each other and put a label that tells users to choose either a length
from the combo or type in their own. You can put code to clear the combo if
user types in the length and vice versa and pop up a message box telling the
user what's happening.
Jeanette Cunningham
> Your not missing anything. I have never been able to make the default
> value
[quoted text clipped - 20 lines]
>>> the
>>> subform information.>The bolts are directly related to the pipe size.
dancox - 02 Feb 2008 23:39 GMT
Yes, the pipe size ties directly to the flange to flange bolt length. Can I
use the flange to flange length as a default value for the Combo Box and
provide a custom list of lengths for all other bolt lengths in a drop down?
I want the default value to show the flange to flange length if the check box
for flange to flange is checked. If the check box is un checked, I would
like it to say "Enter Length" or blank if text is not allowed in the control.
>You can set the rowsource for the length combo box to a query that shows the
>selection of possible flange to flange lengths.
[quoted text clipped - 18 lines]
>>>> the
>>>> subform information.>The bolts are directly related to the pipe size.
Jeanette Cunningham - 03 Feb 2008 00:18 GMT
Yes, I now understand what is required.
Create a union query for the length combo box.
The union query uses the table with custom lengths unioned to the default
value for flange to flange bolt length
You will have a query to select the correct value for flange to flange bolt
length depending on user selection for pipe spec and size.
We will need a way to mark which item on the list is the default value, so
we can set the combo to this default value.
You can do this with an extra field created in the union query - I will call
it DefValue
For example: If you know how to do union queries
"SELECT BoltLength, 1 AS DefValue FROM TableBoltLength WHERE . . . " _
& "UNION " _
& "SELECT BoltLength, 2 As DefValue From TableLengthList ' _
& "ORDER BY BoltLength"
The above query in datasheet view will give you a list that contains both
the default value and the list values for length.
Length DefValue
1.5 1
2.2 2
0.6 2
1.9 2
Where I have: SELECT ... FROM TableBoltLength WHERE . . .
Replace TableBoltLength with your table or tables joined
Build the where clause to include both pipe spec and size from the 2 combos
on the main form
Replace TableLengthList with your table
The above union query is the row source for the length combo
Make column 1 the combo's bound column
When you want to set the default for the combo:
Me.MyCombo.DefaultValue = "SELECT BoltLength, DefValue FROM qUnion WHERE
DefValue = 1"
Where qUnion is the union query from above - you can save the union query
and use it, or you can build it in code.
So the combo will have the default value depending on the user's selection
for pipe spec and size.
The combo's row source will show all the list values including the default
value when it is dropped down.
Jeanette Cunningham
> Yes, the pipe size ties directly to the flange to flange bolt length. Can
> I
[quoted text clipped - 36 lines]
>>>>> the
>>>>> subform information.>The bolts are directly related to the pipe size.