From classicasp.aspfaq dot com
"You can use ' as a delimiter in Access as long as you know your code will always run against a newer version. If there is a chance you will connect to legacy Access versions, you might be safer continuing to use the # delimiter."
Code:
sql = "INSERT INTO Test(dt) VALUES('2004-07-20')"
conn.execute(sql)
sql = "INSERT INTO Test(dt) VALUES(#2004-07-20#)"
conn.execute(sql)
Man that was painful to figure out.....anyway I found the reference for the ActiveXData Objects 2.8 Library...thanks! The error came from the adocmd Dim.
IETM_ID actuallys stands for Interactive Electronic Technical Manual
Here is my fixed code
Code:
Private Sub btnSubmitScore_Click()
Dim lngRow As Long
Dim strItem As String
Dim adocmd As New ADODB.Command
adocmd.activeconnection = CurrentProject.Connection
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
sSql = "INSERT INTO tbl_Scored_Data (EI_ID, Event_Date, Event_No, Sys_Code, IETM_ID)" & _
"Values = ('" & Me.EI_ID & "',#& Me.EVENT_Date&#, " & Me.EVENT_NO & ",'" & Me.SYS_CODE & "','" & strItem & "')"
'Parses through the Listbox
With Me.List68
For lngRow = 0 To List68.ListCount - 1
For Each strItem In List68.ItemsSelected
adocmd.commandtext = sSql & ", " & List68.Column(0, strItem)
adocmd.Execute
Next strItem
'Select the rows in the Listboxs
'If List68.Selected(lngRow) Then
'strItem = strItem & "," & .Column(0, lngRow)
'End If
Next lngRow
End With
'Strips off the leading comma and space
'If Len(strItem) > 2 Then
'strItem = Mid(strItem, 3)
'End If
'Displays the selection held in variable strItem
MsgBox "Tasks: " & strItem
'Shows how many records where created.
'MsbBox "Records Inserted: " & db.RecordsAffected
End Sub
I do need the values of those controls so I'll post what I have finished in the morning I'm done for the day...Thanks for all your help....