It would have been better to post this entirely new question as a new
thread.
At the very least, you are missing an opening parenthesis before the field
list said:
strInsertSQL = "UPDATE tblDevelop [CustName],[Q1S],[Q2S]," & _
That should have been:
strInsertSQL = "UPDATE tblDevelop ([CustName],[Q1S],[Q2S]," & _
I see that you have a closing parenthesis, so I think this is just a typo.
I see a couple of other things that may not be hurting you directly, but
that are worth mentioning.
1. In these statements:
Dim strCustID, strCustName, strQ1, strQ2, strQ3, strQ4, strQ5 As String
Dim strQ6, strQ7, strQ8, strQ9, strQ10, strQ11, strQ12 As String
Dim strQ13, strQ14, strType As String
Dim strInsertSQL, strCustComp As String
... only strQ5, strQ12, strType, and strCustComp are being declared as
String. The rest are all being declared as Variant, which is probably not
what you want. In VB, declarations don't factor that way; you have to
supply the type for every name declared, or have it default to Variant.
2. In this statement:
... why are you using the "int" prefix, which usually connoted an Integer
variable, rather than a Date? Most people who use this naming convention
would use the "dt" prefix: dtDate. On the other hand, I notice that your
code later on is working with a variable called "strDate", which is not
declared. Was that intended to be this same variable? If so, and if it's
holding a date/time value, why are you treating it as a string?
3. Any time I see numbered fields, as in Q1, Q2, Q3, etc., I conclude that
the table design is not normalized. Depending on what you want to do with
these data and how you anticipate querying them, you probably should
consider normalizing your table design so that each question (if that's
what "Q" stands for) is stored in a separate record in a related table.
That, of course, is a larger change and would have an impact on your
design in many places.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Thanks that worked. Now I am trying to modify my initial instert
statement in order to update the table, I am missing something but not
quite sure what, here is the code:
Private Sub cmdSubmit_Click()
Dim strCustID, strCustName, strQ1, strQ2, strQ3, strQ4, strQ5 As
String
Dim strQ6, strQ7, strQ8, strQ9, strQ10, strQ11, strQ12 As String
Dim strQ13, strQ14, strType As String
Dim strInsertSQL, strCustComp As String
Dim intDate As Date
strCustID = Me.txtCustID.Value & ""
strCustName = Me.txtName.Value & ""
strQ1 = Me.txtQ1.Value & ""
strQ2 = Me.txtQ2.Value & ""
strQ3 = Me.txtQ3.Value & ""
strQ4 = Me.txtQ4.Value & ""
strQ5 = Me.txtQ5.Value & ""
strQ6 = Me.txtQ6.Value & ""
strQ7 = Me.txtQ7.Value & ""
strQ8 = Me.txtQ8.Value & ""
strQ9 = Me.txtQ9.Value & ""
strQ10 = Me.txtQ10.Value & ""
strQ11 = Me.txtQ11.Value & ""
strQ12 = Me.txtQ12.Value & ""
strQ13 = Me.txtQ13.Value & ""
strQ14 = Me.txtQ14.Value & ""
strType = Me.txtType.Value & ""
strDate = Me.txtDate.Value & ""
strCustComp = Me.txtCust.Value & ""
strInsertSQL = "UPDATE tblDevelop [CustName],[Q1S],[Q2S]," & _
"[Q3S],[Q4S],[Q5S],[Q6S],[Q7S],[Q8S], [Q9S], [Q10S],
[Q11S], [Q12S], [Q13S], [Q14S]," & _
"[TYPE], [DATE], [CustComp]) " & _
"VALUES (" & Chr$(34) & strCustName & Chr$(34) & ",
" & Chr$(34) & strQ1 & Chr$(34) & ", " & Chr$(34) & strQ2 & Chr$(34) &
", " & _
"'" & strQ3 & "', '" & strQ4 & "', '" & strQ5 & "',
'" & strQ6 & "', '" & strQ7 & "', " & _
"'" & strQ8 & "', '" & strQ9 & "', '" & strQ10 & "',
'" & strQ11 & "', '" & strQ12 & "', '" & strQ13 & "', '" & strQ14 &
"', '" & strType & "', '" & strDate & " ', " & Chr$(34) & strCustComp
& Chr$(34) & ") WHERE tblDevelop.DevID = " & Me.txtDevID.Value
Call DoCmd.RunSQL(strInsertSQL)
MsgBox "Thank You"
End Sub