List Boxes (1 Viewer)

MikeEller

Registered User.
Local time
Today, 09:47
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
 

MikeEller

Registered User.
Local time
Today, 09:47
Joined
Jan 7, 2005
Messages
32
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?
 

WayneRyan

AWF VIP
Local time
Today, 14:47
Joined
Nov 19, 2002
Messages
7,122
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
 

MikeEller

Registered User.
Local time
Today, 09:47
Joined
Jan 7, 2005
Messages
32
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
 

cross5900

Blarg!
Local time
Today, 08:47
Joined
Mar 24, 2006
Messages
92
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

Top Bottom