Input Box not displaying value

C

Christina

I have a form with slots to enter 6 different sign panel
designations. The form then pulls various sign properties
from another table based on the sign panel designation
entered and uses the values to perform a series of
calculations. On property that is displayed is the color
of the sign. In some cases, the sign can be different
colors depending on where it is being used. For this
scenario I have left the color blank in the properties
table and have used If then statements to indicated that
if the color is blank then an Input Box appears and asks
for the sign color. This value is then inputed into the
form. The problem I'm having is that it is only working
for the first sign panel designation. When I use the
immediate box, the code returns the correct value, it just
doesn't display it in the form (or corresponding table).
I have checked the properities of all the color boxes
against the first one (which is displaying) and don't see
any differences.

Any ideas? I have included a portion of the code if it
helps any.

Thanks for your help.
Dim Message1, Message2, Message3, Message4, Message5,
Message6, Title1, Title2, Title3, Title4, Title5, Title6,
Default1, Default2, Default3, Default4, Default5,
Default6, Value1, Value2, Value3, Value4, Value5, Value6,
C1, C2, C3, C4, C5, C6
C1 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation1] & "'")
C2 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation2] & "'")
C3 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation3] & "'")
C4 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation4] & "'")
C5 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation5] & "'")
C6 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation6] & "'")

If Sign_Designation1 = "D2-2" Or Sign_Designation1 = "D-3"
Or Sign_Designation1 = "D2-3" Or Sign_Designation1 = "SR-
1" Or Sign_Designation1 = "D1-202" Or Sign_Designation1
= "W2-6A" Then
Effective_Width1 = DLookup
("[EFFECTIVE_WIDTH1]", "Original_Signs", "[MSLT] ='" &
Forms![Sign_Calcs_Form]![MSLT] & "'")
Effective_Height1 = DLookup
("[Effective_Height1]", "Original_Signs", "[MSLT]='" &
Forms![Sign_Calcs_Form]![MSLT] & "'")
Sign_Size1 = DLookup
("[Sign_Size1]", "Original_Signs", "[MSLT]='" & Forms!
[Sign_Calcs_Form]![MSLT] & "'")
Area_of_Sign1 = (Effective_Width1 * Effective_Height1) /
144
Color1 = DLookup("[Color1]", "Original_Signs", "[MSLT]='"
& Forms![Sign_Calcs_Form]![MSLT] & "'")
Brace_Angle1 = DLookup
("[Brace_Angle1]", "Original_Signs", "[MSLT]='" & Forms!
[Sign_Calcs_Form]![MSLT] & "'")

Else:
If IsNull(Sign_Designation1) = False And IsNull(Color1)
Then
If IsNull(C1) Then
Message1 = "What Color is Sign Designation1?"
Title1 = "Sign Color"
Default1 = "BLUE"
Value1 = InputBox(Message1, Title1, Default1)
Color1 = Value1
Else: Color1 = C1
End If
End If

Effective_Width1 = DLookup
("[EFFECTIVE_WIDTH]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIG
NATION] ='" & Forms![Sign_Calcs_Form]![Sign_Designation1]
& "'")
Effective_Height1 = DLookup
("[Effective_Height]", "sign_properties_table", "[sign_desi
gnation]='" & Forms![Sign_Calcs_Form]![Sign_Designation1]
& "'")
Sign_Size1 = DLookup
("[Size]", "sign_properties_table", "[sign_designation]='"
& Forms![Sign_Calcs_Form]![Sign_Designation1] & "'")
Area_of_Sign1 = (Effective_Width1 * Effective_Height1) /
144
Brace_Angle1 = DLookup
("[Brace_Angle]", "sign_properties_table", "[sign_designati
on]='" & Forms![Sign_Calcs_Form]![Sign_Designation1] & "'")
End If

If Sign_Designation2 = "D2-2" Or Sign_Designation2 = "D-3"
Or Sign_Designation2 = "D2-3" Or Sign_Designation2 = "SR-
1" Or Sign_Designation2 = "D1-202" Or Sign_Designation2
= "W2-6A" Then
Effective_Width2 = DLookup
("[EFFECTIVE_WIDTH2]", "Original_Signs", "[MSLT] ='" &
Forms![Sign_Calcs_Form]![MSLT] & "'")
Effective_Height2 = DLookup
("[Effective_Height2]", "Original_Signs", "[MSLT]='" &
Forms![Sign_Calcs_Form]![MSLT] & "'")
Sign_Size2 = DLookup
("[Sign_Size2]", "Original_Signs", "[MSLT]='" & Forms!
[Sign_Calcs_Form]![MSLT] & "'")
Area_of_Sign2 = (Effective_Width2 * Effective_Height2) /
144
Color2 = DLookup("[Color2]", "Original_Signs", "[MSLT]='"
& Forms![Sign_Calcs_Form]![MSLT] & "'")
Brace_Angle2 = DLookup
("[Brace_Angle2]", "Original_Signs", "[MSLT]='" & Forms!
[Sign_Calcs_Form]![MSLT] & "'")

Else:
If IsNull(Sign_Designation2) = False And IsNull(Color2)
Then
If IsNull(C2) Then
Message2 = "What Color is Sign Designation2?"
Title2 = "Sign Color"
Default2 = "BLUE"
Value2 = InputBox(Message2, Title2, Default2)
Color2 = Value2
Else: Color2 = C2
End If
End If

Effective_Width2 = DLookup
("[EFFECTIVE_WIDTH]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIG
NATION] ='" & Forms![Sign_Calcs_Form]![Sign_Designation2]
& "'")
Effective_Height2 = DLookup
("[Effective_Height]", "sign_properties_table", "[sign_desi
gnation]='" & Forms![Sign_Calcs_Form]![Sign_Designation2]
& "'")
Sign_Size2 = DLookup
("[Size]", "sign_properties_table", "[sign_designation]='"
& Forms![Sign_Calcs_Form]![Sign_Designation2] & "'")
Area_of_Sign2 = (Effective_Width2 * Effective_Height2) /
144
Color2 = DLookup
("[Color]", "sign_properties_table", "[sign_designation]
='" & Forms![Sign_Calcs_Form]![Sign_Designation2] & "'")
Brace_Angle2 = DLookup
("[Brace_Angle]", "sign_properties_table", "[sign_designati
on]='" & Forms![Sign_Calcs_Form]![Sign_Designation2] & "'")
End If
 
B

Bryan Reich [MSFT]

Christina,
I think I may see the problem.
In your assignment to Color2 with the DLookup call right towards the bottom
of your included example code, you are using
"[Color]" as your expression. However, you are trying to populate [Color2]
if I'm not mistaken in this particular call. Could that be the problem? Try
"[Color2]" (and so forth for the others) for this line and see if that
doesn't solve your problem.

--
Bryan

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


Christina said:
I have a form with slots to enter 6 different sign panel
designations. The form then pulls various sign properties
from another table based on the sign panel designation
entered and uses the values to perform a series of
calculations. On property that is displayed is the color
of the sign. In some cases, the sign can be different
colors depending on where it is being used. For this
scenario I have left the color blank in the properties
table and have used If then statements to indicated that
if the color is blank then an Input Box appears and asks
for the sign color. This value is then inputed into the
form. The problem I'm having is that it is only working
for the first sign panel designation. When I use the
immediate box, the code returns the correct value, it just
doesn't display it in the form (or corresponding table).
I have checked the properities of all the color boxes
against the first one (which is displaying) and don't see
any differences.

Any ideas? I have included a portion of the code if it
helps any.

Thanks for your help.
Dim Message1, Message2, Message3, Message4, Message5,
Message6, Title1, Title2, Title3, Title4, Title5, Title6,
Default1, Default2, Default3, Default4, Default5,
Default6, Value1, Value2, Value3, Value4, Value5, Value6,
C1, C2, C3, C4, C5, C6
C1 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation1] & "'")
C2 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation2] & "'")
C3 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation3] & "'")
C4 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation4] & "'")
C5 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation5] & "'")
C6 = DLookup
("[Color]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIGNATION]
='" & Forms![Sign_Calcs_Form]![Sign_Designation6] & "'")

If Sign_Designation1 = "D2-2" Or Sign_Designation1 = "D-3"
Or Sign_Designation1 = "D2-3" Or Sign_Designation1 = "SR-
1" Or Sign_Designation1 = "D1-202" Or Sign_Designation1
= "W2-6A" Then
Effective_Width1 = DLookup
("[EFFECTIVE_WIDTH1]", "Original_Signs", "[MSLT] ='" &
Forms![Sign_Calcs_Form]![MSLT] & "'")
Effective_Height1 = DLookup
("[Effective_Height1]", "Original_Signs", "[MSLT]='" &
Forms![Sign_Calcs_Form]![MSLT] & "'")
Sign_Size1 = DLookup
("[Sign_Size1]", "Original_Signs", "[MSLT]='" & Forms!
[Sign_Calcs_Form]![MSLT] & "'")
Area_of_Sign1 = (Effective_Width1 * Effective_Height1) /
144
Color1 = DLookup("[Color1]", "Original_Signs", "[MSLT]='"
& Forms![Sign_Calcs_Form]![MSLT] & "'")
Brace_Angle1 = DLookup
("[Brace_Angle1]", "Original_Signs", "[MSLT]='" & Forms!
[Sign_Calcs_Form]![MSLT] & "'")

Else:
If IsNull(Sign_Designation1) = False And IsNull(Color1)
Then
If IsNull(C1) Then
Message1 = "What Color is Sign Designation1?"
Title1 = "Sign Color"
Default1 = "BLUE"
Value1 = InputBox(Message1, Title1, Default1)
Color1 = Value1
Else: Color1 = C1
End If
End If

Effective_Width1 = DLookup
("[EFFECTIVE_WIDTH]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIG
NATION] ='" & Forms![Sign_Calcs_Form]![Sign_Designation1]
& "'")
Effective_Height1 = DLookup
("[Effective_Height]", "sign_properties_table", "[sign_desi
gnation]='" & Forms![Sign_Calcs_Form]![Sign_Designation1]
& "'")
Sign_Size1 = DLookup
("[Size]", "sign_properties_table", "[sign_designation]='"
& Forms![Sign_Calcs_Form]![Sign_Designation1] & "'")
Area_of_Sign1 = (Effective_Width1 * Effective_Height1) /
144
Brace_Angle1 = DLookup
("[Brace_Angle]", "sign_properties_table", "[sign_designati
on]='" & Forms![Sign_Calcs_Form]![Sign_Designation1] & "'")
End If

If Sign_Designation2 = "D2-2" Or Sign_Designation2 = "D-3"
Or Sign_Designation2 = "D2-3" Or Sign_Designation2 = "SR-
1" Or Sign_Designation2 = "D1-202" Or Sign_Designation2
= "W2-6A" Then
Effective_Width2 = DLookup
("[EFFECTIVE_WIDTH2]", "Original_Signs", "[MSLT] ='" &
Forms![Sign_Calcs_Form]![MSLT] & "'")
Effective_Height2 = DLookup
("[Effective_Height2]", "Original_Signs", "[MSLT]='" &
Forms![Sign_Calcs_Form]![MSLT] & "'")
Sign_Size2 = DLookup
("[Sign_Size2]", "Original_Signs", "[MSLT]='" & Forms!
[Sign_Calcs_Form]![MSLT] & "'")
Area_of_Sign2 = (Effective_Width2 * Effective_Height2) /
144
Color2 = DLookup("[Color2]", "Original_Signs", "[MSLT]='"
& Forms![Sign_Calcs_Form]![MSLT] & "'")
Brace_Angle2 = DLookup
("[Brace_Angle2]", "Original_Signs", "[MSLT]='" & Forms!
[Sign_Calcs_Form]![MSLT] & "'")

Else:
If IsNull(Sign_Designation2) = False And IsNull(Color2)
Then
If IsNull(C2) Then
Message2 = "What Color is Sign Designation2?"
Title2 = "Sign Color"
Default2 = "BLUE"
Value2 = InputBox(Message2, Title2, Default2)
Color2 = Value2
Else: Color2 = C2
End If
End If

Effective_Width2 = DLookup
("[EFFECTIVE_WIDTH]", "SIGN_PROPERTIES_TABLE", "[SIGN_DESIG
NATION] ='" & Forms![Sign_Calcs_Form]![Sign_Designation2]
& "'")
Effective_Height2 = DLookup
("[Effective_Height]", "sign_properties_table", "[sign_desi
gnation]='" & Forms![Sign_Calcs_Form]![Sign_Designation2]
& "'")
Sign_Size2 = DLookup
("[Size]", "sign_properties_table", "[sign_designation]='"
& Forms![Sign_Calcs_Form]![Sign_Designation2] & "'")
Area_of_Sign2 = (Effective_Width2 * Effective_Height2) /
144
Color2 = DLookup
("[Color]", "sign_properties_table", "[sign_designation]
='" & Forms![Sign_Calcs_Form]![Sign_Designation2] & "'")
Brace_Angle2 = DLookup
("[Brace_Angle]", "sign_properties_table", "[sign_designati
on]='" & Forms![Sign_Calcs_Form]![Sign_Designation2] & "'")
End If
 
Top