M
Mary Hartman
I have written the following sub-routine to fill in 2 fields if a
check box is checked. However, the routine doesn't seem to care if
the check box (products_image_1_use) is checked or not, it fills the
fields when I click on check box and empties it when I click on the
check box no matter the value of the check box. I want the field
filled only when the check box is checked.
It's gotta be something stupid. What have I done wrong?
______
Private Sub products_image_1_use_Click()
Dim products_image_name_sm_1_temp As String
Dim products_image_name_lg_1_temp As String
If Me![products_image_1_use] = Yes Then
products_image_name_sm_1_temp = Me![products_model]
products_image_name_sm_1_temp = products_image_name_sm_1_temp &
"bw.jpg"
Me![products_image_sm_1] = products_image_name_sm_1_temp
products_image_name_xl_1_temp = Me![products_model]
products_image_name_xl_1_temp = products_image_name_xl_1_temp &
"b.jpg"
Me![products_image_xl_1] = products_image_name_xl_1_temp
Else
Me![products_image_sm_1] = vbNullString
Me![products_image_xl_1] = vbNullString
End If
End Sub
check box is checked. However, the routine doesn't seem to care if
the check box (products_image_1_use) is checked or not, it fills the
fields when I click on check box and empties it when I click on the
check box no matter the value of the check box. I want the field
filled only when the check box is checked.
It's gotta be something stupid. What have I done wrong?
______
Private Sub products_image_1_use_Click()
Dim products_image_name_sm_1_temp As String
Dim products_image_name_lg_1_temp As String
If Me![products_image_1_use] = Yes Then
products_image_name_sm_1_temp = Me![products_model]
products_image_name_sm_1_temp = products_image_name_sm_1_temp &
"bw.jpg"
Me![products_image_sm_1] = products_image_name_sm_1_temp
products_image_name_xl_1_temp = Me![products_model]
products_image_name_xl_1_temp = products_image_name_xl_1_temp &
"b.jpg"
Me![products_image_xl_1] = products_image_name_xl_1_temp
Else
Me![products_image_sm_1] = vbNullString
Me![products_image_xl_1] = vbNullString
End If
End Sub