Hello,
I originally had some code that on click put in today's date. Have some issues with that, and probably not the best use in this instance.
So, what I want to achieve is;
1 - Enter a date, the checkbox is then enabled and true. The Date field becomes enabled = false.
2 - Uncheck the checkbox (False) then (with a msgbox) clear the date, checkbox is then disabled. The date field enabled = true.
This is the code I have been working on: (Enter Date)
and: (Uncheck Checkbox)
I have lots of these to do. (My Form)
Do I also need to call these anywhere else??
thanks
**EDIT** I changed the entering date function to after update. I think this is working.
The on click for check box, does nothing when unchecked, but does what it should when click again.
I originally had some code that on click put in today's date. Have some issues with that, and probably not the best use in this instance.
So, what I want to achieve is;
1 - Enter a date, the checkbox is then enabled and true. The Date field becomes enabled = false.
2 - Uncheck the checkbox (False) then (with a msgbox) clear the date, checkbox is then disabled. The date field enabled = true.
This is the code I have been working on: (Enter Date)
Code:
Private Sub TxtIFA_Sent_Change()
If IsNull([TxtIFA_Sent]) Then
Me.ChkIFA_Sent = False
Me.ChkIFA_Sent.Enabled = False
Me.TxtIFA_Sent.Enabled = True
Else
Me.ChkIFA_Sent = True
Me.ChkIFA_Sent.Enabled = True
Me.TxtIFA_Sent.Enabled = False
End If
End Sub
and: (Uncheck Checkbox)
Code:
Private Sub ChkIFA_Sent_Click()
If Me.ChkIFA_Sent = True Then
Dim iResponse As String
iResponse = MsgBox("Are you sure you want to remove the IFA sent date?", vbYesNo)
Select Case iResponse
Case vbYes:
Me.ChkIFA_Sent = False
Me.ChkIFA_Sent.Enabled = False
Me.TxtIFA_Sent.Enabled = True
Me.TxtIFA_Sent = ""
Case vbNo: ' Do Nothing
Me.ChkIFA_Sent = True
End Select
End If
End Sub
I have lots of these to do. (My Form)
Do I also need to call these anywhere else??
thanks
**EDIT** I changed the entering date function to after update. I think this is working.
The on click for check box, does nothing when unchecked, but does what it should when click again.