1. I have a Checkbox control as above in my VB application.
2. I created a Boolean in Access for the Checkbox value.
3. When the Checkbox is checked the current Date & Time is entered automatically.
4. When I save it, Date & Time is save but the Checkbox isn’t
Here is the coding I used :
______________________________________________________
General Declaration
Dim cn As ADODB.Connection 'Connect to a Database.
Public rs As ADODB.Recordset 'Set records.
_______________________________________________________
Private Sub cmdSave_Click()
rs!chkCharged = chkCharged.Value & ""
________________________________________________________
Public Sub PopulateControls()
chkCharged.Value = rs!chkCharged & ""
_________________________________________________________
Private Sub chkCharged_Click()
If chkCharged.Value = Checked Then
txtCharged.Text = Date
txtCTime.Text = Time
txtCharged = Format(Date, "yyyy-mm-dd"
ElseIf chkCharged.Value = Unchecked Then
txtCharged.Text = ""
txtCTime.Text = ""
End If
End Sub