Hello!
I'm currently working for charity that operates within a school in Tanzania, East Africa. Although my skill level in Access is currently completely zilch, I've been asked to try and set up an Access 97 database (running of an ancient Win 98 computer) to replace the existing masses of paper files that deal with the 'hardship fund'.
I'm moderately competent at fiddling around to work things out, but I've come unstuck.
Put simply, I am creating a form that consists of many Yes/No checkboxes ("Box#") and a single Number ("Total") textbox. The idea is that, upon clicking each checkbox, a value is added to the current value of the "Total" box.
I originally attempted this code:
The problem arises when you try to uncheck the checkbox: it continues to add the 500 whether you're checking or unchecking the box. Thus I tried:
But that ended up with an utterly baffling "Else without If" error. So I tried:
In this case, Access both added and subtracted the 500, obviously with a net result of nada.
You may laugh at my efforts, but I've only been using Access a couple of hours, so please, pity me and help!
Thank you,
Joe Bunce
Tanzania
I'm currently working for charity that operates within a school in Tanzania, East Africa. Although my skill level in Access is currently completely zilch, I've been asked to try and set up an Access 97 database (running of an ancient Win 98 computer) to replace the existing masses of paper files that deal with the 'hardship fund'.
I'm moderately competent at fiddling around to work things out, but I've come unstuck.
Put simply, I am creating a form that consists of many Yes/No checkboxes ("Box#") and a single Number ("Total") textbox. The idea is that, upon clicking each checkbox, a value is added to the current value of the "Total" box.
I originally attempted this code:
Code:
Private Sub Box1_Click ()
Total.Value = Total.Value + 500
End Sub
Code:
Private Sub Box1_Click ()
If Box1 = "No" Then Total.Value = Total.Value + 500
Else Total.Value = Total.Value - 500
End Sub
Code:
Private Sub Box1_Click ()
If Box1 = "No" Then Total.Value = Total.Value + 500
If Box1 = "Yes" Then Total.Value = Total.Value - 500
End Sub
You may laugh at my efforts, but I've only been using Access a couple of hours, so please, pity me and help!
Thank you,
Joe Bunce
Tanzania
Last edited: