B
bob
Can some one tell me what I am doing wrong here? creating
a clone of a form which is getting half the values from a
table and the other half are entered by the user on the
form. This recordset is then suppose to insert the records
in to the table.
The error is a syntax error wnd is the last line in the
insert query code.
Private Sub Command46_Click()
Dim strsql As String
Dim rs As DAO.Recordset
Dim db As DAO.Database ' for insert queries
Set db = CurrentDb
Set rs = Me.RecordsetClone
With rs
If .RecordCount <> 0 Then .MoveFirst
Do Until .EOF
'try entering only one value
strsql = _
"insert into tblattendance" & _
"(tblattendance.programcode)"
"VALUES("!progcode & ") ' error here
db.Execute strsql, dbFailOnError
.MoveNext
Loop
End With
Set rs = Nothing
Set db = Nothing
End Sub
a clone of a form which is getting half the values from a
table and the other half are entered by the user on the
form. This recordset is then suppose to insert the records
in to the table.
The error is a syntax error wnd is the last line in the
insert query code.
Private Sub Command46_Click()
Dim strsql As String
Dim rs As DAO.Recordset
Dim db As DAO.Database ' for insert queries
Set db = CurrentDb
Set rs = Me.RecordsetClone
With rs
If .RecordCount <> 0 Then .MoveFirst
Do Until .EOF
'try entering only one value
strsql = _
"insert into tblattendance" & _
"(tblattendance.programcode)"
"VALUES("!progcode & ") ' error here
db.Execute strsql, dbFailOnError
.MoveNext
Loop
End With
Set rs = Nothing
Set db = Nothing
End Sub