Summing a total

Joshfraser.csdms

New member
Local time
Today, 13:33
Joined
Jun 18, 2016
Messages
8
Hi I am trying to create a Jeopardy like game using access. I have created a form(called jeopardy) with my first category. To start I only have one option (200 points). On that same form I have a caption for team one and team two points. This is where I want the totals to be. when that button is clicked it pops open a new form window(FRMNV200). In that window I have 4 checkboxes correct answer, wrong answer, team1 and team2. If I check off team1 and correct I want 200 points to be added the total. If I check off team1 and wrong I want -200 points to be added to the total. This is the code I have for this but it isn't working for me.

Code:
Option Compare Database
Public team1, team2 As Integer
team1 = NV200Plus Or NV200Minus


Private Sub BttnNV200Finished_Click()
Dim NV200Plus, NV200Minus As Integer
If ChkCorrNV200 And ChKNV200T1 = True Then
    NV200Plus = 200
ElseIf ChkWrongNV200 And ChKNV200T1 = True Then
    NV200Minus = -200
End If
Forms.lblPointsT1.Caption = team1
DoCmd.Close acDefault, FrmNV200, acSavePrompt
End Sub
 
It seems that you are not talking to the objects (fields) on the form.
So, if you field is called 'Score', then you need to say
me.score = 200 or me.score = -200
However - if this is a running total, then you would say
me.score = me.score + 200 or me.score = me.score - 200
Hope that gets you going
 
The first thing to talk about in a new database system is the tables. How are your tables set up?
 

Users who are viewing this thread

Back
Top Bottom