I have a yes/no field called Action Required. I want the following field (a memo box called Action Details) to only show if the checkbox is set to yes (IE: you can't access the memo box at all if the checkbox is not checked). Is this possible?
Function ShowMemo()
Me.MemoControlNameHere.Visible = Me.CheckBoxNameHere
End Function
Thank you so much for the reply.
I'm hung up on "add a function to your form's module"
Private Function ShowMemo()
If Me.CheckBoxNameHere Then
Me.MemoControlNameHere.Visible = True
Else
Me.MemoControlNameHere.Visible = False
Me.MemoControlNameHere = Null
End If
End Function
Private Function ShowFields()
If Me.OtherUnivEmployeesInvolved Then
Me.OtherUnivEmployeeFullName1.Visible = True
Else
Me.OtherUnivEmployeeFullName1.Visible = False
Me.OtherUnivEmployeeFullName1 = Null
End If
End Function
Private Sub Form_Current()
ShowFields
End Sub
Private Sub OtherUnivEmployeesInvolved_AfterUpdate()
ShowFields
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
If (Me.OtherUnivEmployeesInvolved) = True And IsNull(Me.frmSunlightInput.Form.OtherUnivEmployeeFullName1) Then
MsgBox Me.OtherUnivEmployeeFullName1 & " Cannot Be Left Empty!"
Cancel = True
End If
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.Tag <> "skip" Then
If ctrl.ControlType = acTextBox Then
If IsNull(ctrl) Then
MsgBox ctrl.Name & " Cannot Be Left Empty!"
Cancel = True
ctrl.SetFocus
Exit Sub
End If
End If
End If
Next
MsgBox "Record Saved!"
End Sub