Public Variable, multiple users

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a public variable TotalPoints that I want to use to total points from several forms.

Each time a student finishes a form's I want the PointsEarned field to add its value to the variable TotalPoints.

I tried this code in the onClose Event:

TotalPoints = Me.PointsEarned + TotalPoints

but I get an error message. I have NO ability when it comes to writing code, I'm stuck as a wizard guy. Can someone help me with this?

Thanks As Always,
RIP
 
RIP, What's the error message and how/where did you
declare the variable.

I would do this.

Open a module and create a functiond called TPoints().
Declare the variable here in the declarations section as
shown below:

Global TotalPoints

Then write the function as shown below:

Function TPoints()

TotalPoints = TotalPoints + Forms!YourFormName!
PointsEarned

End Function

Set the OnClose event to:

Call TPoints()

This should solve your problem.

Xcelsoft


-----Original Message-----
I have a public variable TotalPoints that I want to use
to total points from several forms.
Each time a student finishes a form's I want the
PointsEarned field to add its value to the variable
TotalPoints.
I tried this code in the onClose Event:

TotalPoints = Me.PointsEarned + TotalPoints

but I get an error message. I have NO ability when it
comes to writing code, I'm stuck as a wizard guy. Can
someone help me with this?
 
Back
Top