S
Supe
I have an Access database for tracking my golf scores. Set up a form for
entering my scores where I hit a button to add the score after entering the
information. It works fine when I enter one score, but if I try to enter
another score right after I get a 3421 Data Type Conversion error. Code is
below. When I hit the debug error it brings me to the "temptable![SCRAMBLE
SCORE] = Nz(SCRAMBLESCORE)" line.
Private Sub AddRound_Click()
Dim temptable As DAO.Recordset
Set temptable = CurrentDb.OpenRecordset("tblData", dbOpenDynaset)
temptable.AddNew
temptable![GOLFMONTH] = SCOREMONTH
temptable![DAY] = DAY
temptable![YEAR] = YEAR
temptable![COURSE] = cbocourse
temptable![City] = City
temptable![State] = State
temptable![Par] = Par
temptable![HOLES] = HOLES
temptable![SELF SCORE] = Nz(SELFSCORE)
temptable![SCRAMBLE SCORE] = Nz(SCRAMBLESCORE)
temptable![SCRAMBLE PARTNER(S)] = SCRAMBLEPARTNER
temptable![TOURNAMENT] = TOURNAMENT
temptable![TOURNAMENT SCORE] = Nz(TOURNAMENTSCORE)
temptable.Update
temptable.Close
SCOREMONTH = ""
DAY = ""
YEAR = ""
cbocourse = ""
City = ""
State = ""
Par = ""
HOLES = ""
SELFSCORE = ""
SCRAMBLESCORE = ""
SCRAMBLEPARTNER = ""
TOURNAMENT = ""
TOURNAMENTSCORE = ""
End Sub
entering my scores where I hit a button to add the score after entering the
information. It works fine when I enter one score, but if I try to enter
another score right after I get a 3421 Data Type Conversion error. Code is
below. When I hit the debug error it brings me to the "temptable![SCRAMBLE
SCORE] = Nz(SCRAMBLESCORE)" line.
Private Sub AddRound_Click()
Dim temptable As DAO.Recordset
Set temptable = CurrentDb.OpenRecordset("tblData", dbOpenDynaset)
temptable.AddNew
temptable![GOLFMONTH] = SCOREMONTH
temptable![DAY] = DAY
temptable![YEAR] = YEAR
temptable![COURSE] = cbocourse
temptable![City] = City
temptable![State] = State
temptable![Par] = Par
temptable![HOLES] = HOLES
temptable![SELF SCORE] = Nz(SELFSCORE)
temptable![SCRAMBLE SCORE] = Nz(SCRAMBLESCORE)
temptable![SCRAMBLE PARTNER(S)] = SCRAMBLEPARTNER
temptable![TOURNAMENT] = TOURNAMENT
temptable![TOURNAMENT SCORE] = Nz(TOURNAMENTSCORE)
temptable.Update
temptable.Close
SCOREMONTH = ""
DAY = ""
YEAR = ""
cbocourse = ""
City = ""
State = ""
Par = ""
HOLES = ""
SELFSCORE = ""
SCRAMBLESCORE = ""
SCRAMBLEPARTNER = ""
TOURNAMENT = ""
TOURNAMENTSCORE = ""
End Sub