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?
 

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

Similar Threads


Back
Top