3134 error

T

tracktraining

Hi All,

I am getting the 3134 Error message (Syntax error in INSERT INTO statement.)
and I would like to know how to resolve it. Please help.

Background information:

There is a yes/no box (trainreq). When the user enters the form, I want
TrainReq to default to True (i.e. the check box is checked). Thus, all the
boxes that were unchecked before (the last time the form was closed) should
be checked when the form open again.

Private Sub Form_Open(Cancel As Integer)
Dim db As Database
Dim rs As DAO.Recordset
Dim UpdateTrainReq As String
Set db = CurrentDb

Set rs = Me.RecordsetClone
rs.MoveFirst

'check the trainreq if box is uncheck (start all boxes off with true and
let the user uncheck the box)
'user don't check box, user only uncheck box
Do Until rs.EOF
MsgBox "Do Until"
If Not rs!TrainReq = True Then
MsgBox "Loop"
UpdateTrainReq = " Insert into EmpDocStatus ( TrainReq ) Value
('True')"
db.Execute (UpdateTrainReq)
End If
rs.MoveNext
Loop
End Sub

Thank you,
Tracktraining
 
T

tracktraining

Hi All,

I fixed the 3134 error on my own after looking at the code with the
following changes:

UpdateTrainReq = " Insert into EmpDocStatus ( TrainReq ) VALUES (True)"

But it is still not checking the box when the form opens (i.e. the box that
was unchecked before is still unchecked and the box that was checked is still
check). I want all the boxes to be checked when form opens.

Suggestions????
 
T

tracktraining

nevermind.

i figured it out.

I am supposed to use the update statement not in insert statement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top