I was using this for a multiselect frm with two listboxes on each side where I was able to update the selected field in one to place it in the other lstbox and then open the appropriate form by whether selected field is yes. I have been using this successfully until now. The field "insurance" is in the "insurance" table and is the primary key. I get a missing operator message.
Dim db As Database, rs As Recordset, sql As String
Dim L As Control
Set L = Me![lstinsurance] 'the name of the unbound lstbox
Set db = CurrentDb
sql = "SELECT [Selected],[insurance].[insurance] FROM [insurance] where [insurance].[insurance] = " & L
Set rs = db.OpenRecordse t(sql, DB_OPEN_DYNASET )
rs.Edit
rs("selected") = True
rs.Update
rs.Close
Me.Recalc
thanks for any help with this. alan
Dim db As Database, rs As Recordset, sql As String
Dim L As Control
Set L = Me![lstinsurance] 'the name of the unbound lstbox
Set db = CurrentDb
sql = "SELECT [Selected],[insurance].[insurance] FROM [insurance] where [insurance].[insurance] = " & L
Set rs = db.OpenRecordse t(sql, DB_OPEN_DYNASET )
rs.Edit
rs("selected") = True
rs.Update
rs.Close
Me.Recalc
thanks for any help with this. alan
Comment