Hi all,
Still trying to get a grip on lstboxes. This is my latest syntax error.
Form is setup this way.
one unbound multi-select lstbox (lsttechnique) populates correctly set to extended column count 1 bound column 1.
3 unbound txtboxes as follows:
txtbrfid dtatype number
txtfreq datatype number
txttotdur datatype number
brfid is pulled from form that opened this form and comes in correctly
freq and totdur are typed in by end user.
lsttechnique is various techniques used
cmdaddtech has the follwing code:
Private Sub cmdaddtech_Click()
Dim db As DAO.Database
Dim varItem As Variant
Set db = CurrentDb
With Me.lsttechnique
For Each varItem In .ItemsSelected
db.Execute _
"INSERT INTO tblNSCIPRLessRestrictive " & _
"(Brfid, Technique, Freq, totdur) " & _
"VALUES (" & _
.ItemData(varItem) & ", " & _
Chr(34) & Me.txtFreq & Chr(34) & ", " & _
Chr(34) & Me.txtTotdur & Chr(34) & ", " & _
Chr(34) & Me.txtBRFID & Chr(34) & ", " & _
dbFailOnError
Next varItem
End With
myReply = MsgBox("Are you sure you want to add this/these techniques?", vbYesNo)
If myReply = vbYes Then
DoCmd.Requery
End If
End Sub
When I click it I get a runtime error 3075 with missing operator in query expression with the selection I choose in the lsttechnique in single quotes.
exact error is Syntax error (missing operator) in query expression 'One are release'.
Thanks in advance