List box mulitple item update

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a combo1 box that grabs one record from table1.

I have a list box where I can grab multiple records from tabl2.

How can I update the selected records from table2, fieldx with the
information from combo1.

Thanks,
Steve
 
Let me clarify this a bit.

Table "table 1"
fields: f1,f2,f3
Bound field f1
My listbox runs off a "table 1" boundto f1. If I use a multi select, I would
like to update f2 with the word"Hello" and f3 with the value 10.
List box name listbox1

F2 is a text field and f3 is long integer.

I tried to use the code

Dim x As Variant, rs As Recordset



Set mydb = DBEngine.workspaces(0).databases(0)

For Each x In Me.listbox1.ItemsSelected
Set rs = mydb.openrecordset("SELECT * FROM "table 1"" & "WHERE
[f1].recordidentifer = recordidentifier.Value")
Set rs = mydb.OpenRecordset("table 1")
Me.Listbox1.Column(0) = "hello"
Me.Listbox1.Column(2) = 10
rs.Update
Next x

This is code I have tried to pull together from different sources. I have no
idea what I am doing.

HELP
 
Back
Top