List Boxes

MikeEller

Registered User.
Local time
Today, 11:01
Joined
Jan 7, 2005
Messages
32
If I use a list box on a form how can I associate that listbox to a memo field in a table? Can I do this?
I am doing it in VB and all works but the text that is added to the list box does not save to the memo field in the table.

I want to be able to select items from one list box and copy them into another. This is working fine. however, the second list box should save its new data to the memo field in the associated table....this is not working.

Thanks for the assistance,
Mike
 
If this cannot be done, can I add new line characters to text strings as they are entered into a multiline text box to achieve the same results?
 
Mike,

You can bind the ListBox to your memo field. Just set it's ControlSource to
the name of your memo field. It will probably be column #2 or #3 or whatever.

If you use a TextBox, go to Tools --> Options and select the Keyboard TAB.
Set Move After Enter to Don't Move.

Better yet, to continuously collect information, have your memo field Visible
and locked, in another UNBOUND textbox use the BeforeUpdate event to

Me.YourMemoField = Me.YourMemoField & vbCrLf & Me.YourUnboundTextBox

You can even add NOW() or Date to Timestamp the entry.

hth,
Wayne
 
Wayne,
I bound the listbox to the memo field. The listbox acts correctly on the form. However, items that are added to the list box are not being saved to the memo field in the table. It remains blank. How do I capture the listbox text to the memo field in the table?
Mike
 
I am having a similar issue to this, Mine works... I double-click the name and its in the textbox.. only problem is it doesnt let me do multiple names, it basically jsut writes over it... never letting me have more than 1 name. My code is below, thanks for hte help in advance.

Private Sub lboxAssociate_DblClick(Cancel As Integer)
Dim newName As Variant
Dim Selection As Variant

Selection = Me.lboxAssociate.ItemData(Me.lboxAssociate.ItemsSelected.Item(0))
newName = lboxAssociate.Column(1) & " - " & cmbCodes.Column(1) & vbCrLf

'MsgBox Me.lboxAssociate.ItemData(Me.lboxAssociate.ItemsSelected.Item(0))
If Selection Then
InputText = newName
End If
 

Users who are viewing this thread

Back
Top Bottom