Are they possible?
I have a form where a trainee surname, forename, employer along with some other details are entered. When I click an "Add" button, I would like the details to be added to a multiple column listbox. This would be done through Visual Basic code. Since in Access Visual Basic there is no "lst.AddItem" method, I have created my own as follows:
Sub AddListItem(lst As Control, S As String)
With lst
If (.ControlType = acComboBox) Or (.ControlType = acListBox) Then
If .RowSourceType = "Value List" Then
If .ListCount > 0 Then
.RowSource = .RowSource & "; " & S
Else
.RowSource = .RowSource & S
End If
End If
End If
End With
End Sub
For example, to add "hello" to the lstPointless listbox, I call:
AddListItem lstPointless, "hello"
This then builds up the RowSource and adds the values to the list. However, it only works with single-column listboxes. I was wondering if multiple column value lists are possible and if so, how do I do them?
Thanks
I have a form where a trainee surname, forename, employer along with some other details are entered. When I click an "Add" button, I would like the details to be added to a multiple column listbox. This would be done through Visual Basic code. Since in Access Visual Basic there is no "lst.AddItem" method, I have created my own as follows:
Sub AddListItem(lst As Control, S As String)
With lst
If (.ControlType = acComboBox) Or (.ControlType = acListBox) Then
If .RowSourceType = "Value List" Then
If .ListCount > 0 Then
.RowSource = .RowSource & "; " & S
Else
.RowSource = .RowSource & S
End If
End If
End If
End With
End Sub
For example, to add "hello" to the lstPointless listbox, I call:
AddListItem lstPointless, "hello"
This then builds up the RowSource and adds the values to the list. However, it only works with single-column listboxes. I was wondering if multiple column value lists are possible and if so, how do I do them?
Thanks