I have a form that when one of three boxes is checked it adds the value to a field on the subform. How do I update the field to the new value if the user changes it after it has already added the previous selection?
My code to add the value is:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Parent.Check40 = True Then
Me.SItemType.Value = "A"
Else
If Me.Parent.Check36 = True Then
Me.SItemType.Value = "B"
Else
If Me.Parent.Check38 = True Then
Me.SItemType.Value = "U"
Else
Me.SItemType.Value = Null
End If
End If
End If
Me.SEstIni = Me.Parent.Combo51
End Sub
(Yes, I need to rename the boxes for structure but am testing in one database and adding to database being used with correct structure when it works properly)
My code to add the value is:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Parent.Check40 = True Then
Me.SItemType.Value = "A"
Else
If Me.Parent.Check36 = True Then
Me.SItemType.Value = "B"
Else
If Me.Parent.Check38 = True Then
Me.SItemType.Value = "U"
Else
Me.SItemType.Value = Null
End If
End If
End If
Me.SEstIni = Me.Parent.Combo51
End Sub
(Yes, I need to rename the boxes for structure but am testing in one database and adding to database being used with correct structure when it works properly)