Help with putting a condition on a sum

  • Thread starter Thread starter Jarem595
  • Start date Start date
J

Jarem595

Hey,
Summarry:
I am currently building a database for my department at work. I
includes a point system that is implemented at work. You can have u
to ten points until you are terminated. And, one point is subtracte
one month from the last offense enetered. We did this by paper, an
now it is on access.

Problem:
I have the form ready, with the subform showing the history of th
employee, that way you can see how many points they currently have, an
now whether or not the employee is going to be fired if you give the
one or two points. The problem comes with the negative points that
have included. Though it would be nice, an employee cannot hav
negative points.

The way it is set up right now, is that i have a total of points (in
text box) in the footer of the subform, and a textbox in the main form
that refrences the textbox in the subform. I have to put a conditio
on this so that it cannot be less than zero! If any one can help, i'
be greatful
 
Jarem595 said:
You can have up
to ten points until you are terminated.

WOW! Aggressive strategy! ;-)
And, one point is subtracted
one month from the last offense enetered. We did this by paper, and
now it is on access.

Problem:
The problem comes with the negative points that i
have included. Though it would be nice, an employee cannot have
negative points.

What do you want? There is a contradictory situation. You have malus
points (marked positive, but when you have ten of those...zap!) and did
you also enter bonus points (marked negative)? You have to do the sum to
get at the actual 'saldo'. There must be a way to enter the 'forgiving'
points, right?
 
-----Original Message-----

Hey,
Summarry:
I am currently building a database for my department at work. It
includes a point system that is implemented at work. You can have up
to ten points until you are terminated. And, one point is subtracted
one month from the last offense enetered. We did this by paper, and
now it is on access.

Problem:
I have the form ready, with the subform showing the history of the
employee, that way you can see how many points they currently have, and
now whether or not the employee is going to be fired if you give them
one or two points. The problem comes with the negative points that i
have included. Though it would be nice, an employee cannot have
negative points.

The way it is set up right now, is that i have a total of points (in a
text box) in the footer of the subform, and a textbox in the main form,
that refrences the textbox in the subform. I have to put a condition
on this so that it cannot be less than zero! If any one can help, i'd
be greatful!


------------------------------------------------

~~View and post usenet messages directly from http://www.ExcelForum.com/

.

Reply.

One way is it do an iif condition on current records.

Make an extra totals box that shows "0" all the time and
make it the same size as the total box. When the total
is less than zero it makes it invisible and the extra box
visible. This way you do not mess up your calculations.
Possible code as follows:

Private Sub Form_Current()

Totals.Visible = True 'When record is first displayed
show value
Totals1.Visible = False 'When record is first displayed
hide extra box

If Totals.Value < 0 Then 'test if less than zero
Totals.Visible = False 'if so hide totals box
Totals1.Visible = True ' and show extra totals
box
Else
End If
End Sub

This is one way
 
Back
Top