kellyputty
Technical User
I would simply like to enable/disable controls based on whether a checkbox is checked. However, the following code creates a record even before the actual update. For example, if I check the checkbox, then change my mind and uncheck it, there is a blank record inserted into table tblCarpenters.
How does one write code so that no records are created until an update, such as, navigating to the next record?
-----------------------------------------------------------
How does one write code so that no records are created until an update, such as, navigating to the next record?
-----------------------------------------------------------
Code:
Private Sub Carpenter_Click()
If Me.Carpenter.Value = True Then
Me.tblVocations_ClientID = Me.tblClients_ClientID.Value
Me.tblCarpenters_ClientID.Value = Me.tblClients_ClientID.Value
Me.tblCarpenters_YearsExperience.Enabled = Carpenter
Me.tblCarpenters_HasOwnTools.Enabled = Carpenter
Me.tblCarpenters_NeedsTraining.Enabled = Carpenter
Me.tblCarpenters_Certifications.Enabled = Carpenter
Else
Me.tblVocations_ClientID = Null
Me.tblCarpenters_ClientID.Value = Null
Me.tblCarpenters_YearsExperience.Value = Null
Me.tblCarpenters_YearsExperience.Enabled = False
Me.tblCarpenters_HasOwnTools.Value = Null
Me.tblCarpenters_HasOwnTools.Enabled = False
Me.tblCarpenters_NeedsTraining.Value = Null
Me.tblCarpenters_NeedsTraining.Enabled = False
Me.tblCarpenters_Certifications.Value = Null
Me.tblCarpenters_Certifications.Enabled = False
End If
End Sub