G
gdfastball
I have created a form to keep track of a video collection. I have 2 combo
boxes and a text box that are "linked". The first combo box is a yes/no box
that tells if the video is owned. The second combo box is a list box that has
options such as "currently with Bob" or "currently with Joe", etc. The text
box is a "checked out to..." box that allows users to enter a name.
I have written the code in VBA to disable the 2nd combo box and text box if
the first combo box is set to "no". My problem is that the code works but
disables the 2nd combo box and text box for all records rather than just for
that record. I need to have each record independent of the others in this
regard.
Here is the code I have for the 1st combo box:
Private Sub OriginalCopy1_AfterUpdate()
If OriginalCopy1.Value = "No" Then
CheckoutStatus1.Enabled = False
CheckoutStatus1.Value = ""
CheckedOutTo1.Enabled = False
CheckedOutTo1.Value = ""
Else
CheckoutStatus1.Enabled = True
CheckedOutTo1.Enabled = True
End If
End Sub
Please help me!
boxes and a text box that are "linked". The first combo box is a yes/no box
that tells if the video is owned. The second combo box is a list box that has
options such as "currently with Bob" or "currently with Joe", etc. The text
box is a "checked out to..." box that allows users to enter a name.
I have written the code in VBA to disable the 2nd combo box and text box if
the first combo box is set to "no". My problem is that the code works but
disables the 2nd combo box and text box for all records rather than just for
that record. I need to have each record independent of the others in this
regard.
Here is the code I have for the 1st combo box:
Private Sub OriginalCopy1_AfterUpdate()
If OriginalCopy1.Value = "No" Then
CheckoutStatus1.Enabled = False
CheckoutStatus1.Value = ""
CheckedOutTo1.Enabled = False
CheckedOutTo1.Value = ""
Else
CheckoutStatus1.Enabled = True
CheckedOutTo1.Enabled = True
End If
End Sub
Please help me!