List Boxes - Access 2003

Joined
Feb 20, 2012
Messages
1
Reaction score
0
Hi

I want to update a column in a table using a list box

i am having issues with the following code in red

any ideas please

Private Sub cmdAdd_Click()
On Error GoTo Err_cmdAdd_Click
Dim i As Integer
Dim strIN As String
Dim strWhere As String
Dim StrIdno As Integer
StrIdno = Me!Idno

For i = 0 To List54.ListCount - 1
If List54.Selected(i) Then
strIN = strIN & List54.Column(0, i) & ","
End If
Next i

strWhere = Left(strIN, Len(strIN) - 1)

DoCmd"UPDATE tbl_main " & _
SET tbl_main.HeadTo = '" & strWhere & "'" & _
WHERE tbl_main.Idno =" & StrIdno & ";"

Exit_cmdAdd_Click:
Exit Sub
End Sub


if it cannot be done....Is there a way please of selecting multiple items from a listbox (in simple or extended), clicking a add button. When you click the add button the data moves across to a multilined text box on the same form. I dont know how to word the code.

List54 (listbox name), Text61(textbox name)

frm_main (name of form)

Jo x :(
 
Last edited:

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