Increasing record value by 1?

W

wolfpack

I would like to increase the value of a record by 1 every time an action
takes place.

I have 3 tables. One is people that contains the names of employees, one is
reviews and has 4 columns (ID#,Accept,Decline,Other - all values except ID
are initially set to 0), and relationship table that matches only one name to
only one review ID.

What I want to do is set up a form where I can choose an employee and use a
check box to choose either accept, decline or other. Once i have choosen the
correct check box I would like to click a "submit" button. Now I would like
for the value of the choosen check box to increase by one for that employee.

For example, Bob is a new employee and has just reviewed a loan. He accepts
the loan. I use the above form to keep track and chose Bob's name and check
the Accept box. Now the value for accept associated with Bob should be 1. If
Bob accepted another loan then the value would increase to 2 and so on.

Thanks for the help.
 
K

Klatuu

Create a hidden bound textbox control for each field on your form.
Create 3 unbound check boxes.
In the Form Current event, set all the check boxes to false.

With Me
.chkAccept = False
.chkDecline = False
.chkOther = False
End With

Then in the After Update event of each check box, you will want to increment
the value of the associated control by one when the user checks it. You will
also want to decrement the control by one if the user changes her mind and
unchecks it.

Private Sub chkAccept_AfterUpdate()

With Me
If .chkAccept = True Then
.txtAccept = .txtAccept + 1
Else
.txtAccept = .txtAccept - 1
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top