Hi all,
I am working on a database system and I'm using checkboxes.
In the Water treatment part, when I check any of these checkboxes, I get the value true to all records. While it should be True when checked and False when not.
I'm using this vba code to control it:
Private Sub Form_Current()
a = Water_Treatment
If a - 8 >= 0 Then
a = a - 8
Aqua_tablet = True
Else
Aqua_tablet = False
End If
If a - 4 >= 0 Then
a = a - 4
Boiling = True
Else
Boiling = False
End If
If a - 2 >= 0 Then
a = a - 2
Clorination = True
Else
Clorination = False
End If
If a - 1 >= 0 Then
a = a - 1
wFilter = True
Else
wFilter = False
End If
End Sub
Private Sub Boiling_AfterUpdate()
If Boiling = True Then
Water_Treatment.Value = Water_Treatment.Value + 4
Else
Water_Treatment.Value = Water_Treatment.Value - 4
End If
End Sub
Private Sub Clorination_AfterUpdate()
If Clorination = True Then
Water_Treatment.Value = Water_Treatment.Value + 2
Else
Water_Treatment.Value = Water_Treatment.Value - 2
End If
End Sub
Private Sub Aqua_tablet_AfterUpdate()
If Aqua_tablet = True Then
Water_Treatment.Value = Water_Treatment.Value + 8
Else
Water_Treatment.Value = Water_Treatment.Value - 8
End If
End Sub
Private Sub wFilter_AfterUpdate()
If wFilter = True Then
Water_Treatment.Value = Water_Treatment.Value + 1
Else
Water_Treatment.Value = Water_Treatment.Value - 1
End If
End Sub
Can anybody help me with this ?
Thank you in advance
Regards,