Not sure if you mean a combo box or a list box, but I guess it doesn't matter. The end result eill be the dame.
Set the visible property of the text box "date_bap" to "No".
Add the following code to the combo box after update event.
Code:
Private Sub bap_AfterUpdate()
If Nz(Me.bap, "No") = "Yes" Then
Me.date_bap.Visible = True
Else
Me.date_bap = vbNullString ' clear any existing value
Me.date_bap.Visible = False
End If
End Sub
Then you also need to add code to the form current event:
Code:
Private Sub Form_Current()
Me.date_bap.Visible = (Nz(Me.bap, "No") = "Yes")
End Sub
The top two lines of the module (every module) should be
Code:
Option Compare Database
Option Explicit
Edit: Oops......Welshgasman beat me.....