S
Simon
Hi
I'm basically try to reused code from "Programming MS Access version2002"
I get an EM telling there is a syntax error when sub below is called it
debigs to the .execute line, the Variables are correctly containing the data
I'm expecting - Can anyone help me understand where I've gone wrong?
Many thanks
Snippet of code:
Sub UpdateSplit(strClassType As String, dblPassClassID As Double,
strPassClassNo As String, strPassClassTitle As String, strJudge As String,
strShowSection As String, strSectionID As String, strClassTypeID As String,
strClassStatusID As String, strClassRef As String, intOpenID As Integer,
strStatus As String, strSponsoredBy As String, strNameOf As String)
Dim cmdUpdate As ADODB.Command
Set cmdUpdate = New Command
Select Case strClassType
Case "Open"
With cmdUpdate
.ActiveConnection = CurrentProject.Connection
.CommandText = "INSERT INTO tblClassInfo(dblPassClassID,
strPassClassNo, strPassClassTitle, strJudge, strShowSection, strSectionID,
strClassTypeID, strClassStatus, strClassRef, intOpenID, strStatusID,
strSponsoredBy, strNameof)) VALUES (" & dblPassClassID & "," & strPassClassNo
& "," & strPassClassTitle & "," & strJudge & "," & strShowSection & "," &
strSectionID & "," & strClassTypeID & "," & strClassStatusID & "," &
strClassRef & "," & intOpenID & "," & strStatus & "," & strSponsoredBy & ","
& strNameOf & ")"
.CommandType = adCmdText
.Execute
End With
I'm basically try to reused code from "Programming MS Access version2002"
I get an EM telling there is a syntax error when sub below is called it
debigs to the .execute line, the Variables are correctly containing the data
I'm expecting - Can anyone help me understand where I've gone wrong?
Many thanks
Snippet of code:
Sub UpdateSplit(strClassType As String, dblPassClassID As Double,
strPassClassNo As String, strPassClassTitle As String, strJudge As String,
strShowSection As String, strSectionID As String, strClassTypeID As String,
strClassStatusID As String, strClassRef As String, intOpenID As Integer,
strStatus As String, strSponsoredBy As String, strNameOf As String)
Dim cmdUpdate As ADODB.Command
Set cmdUpdate = New Command
Select Case strClassType
Case "Open"
With cmdUpdate
.ActiveConnection = CurrentProject.Connection
.CommandText = "INSERT INTO tblClassInfo(dblPassClassID,
strPassClassNo, strPassClassTitle, strJudge, strShowSection, strSectionID,
strClassTypeID, strClassStatus, strClassRef, intOpenID, strStatusID,
strSponsoredBy, strNameof)) VALUES (" & dblPassClassID & "," & strPassClassNo
& "," & strPassClassTitle & "," & strJudge & "," & strShowSection & "," &
strSectionID & "," & strClassTypeID & "," & strClassStatusID & "," &
strClassRef & "," & intOpenID & "," & strStatus & "," & strSponsoredBy & ","
& strNameOf & ")"
.CommandType = adCmdText
.Execute
End With