Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / November 2007

Tip: Looking for answers? Try searching our database.

update list box selections into text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
c8tz - 07 Nov 2007 09:51 GMT
Hi,

I have a list box and a command button and a text box on a form.  What
I would like to do is when selections are done from the list box, the
command button is used to update the selections into the text box.

Is this possible to do - Thank you for your assistance.
Martin J. - 07 Nov 2007 11:59 GMT
> Hi,
>
[quoted text clipped - 3 lines]
>
> Is this possible to do - Thank you for your assistance.

after clicking the command button the currently selected entry in the
listbox is written into the textbox. Is this what you wanted?

Private Sub MyCommandButton_Click()
   MyTextBox.Value = MyListBox.Value
End Sub

Martin
fredg - 07 Nov 2007 15:30 GMT
> Hi,
>
[quoted text clipped - 3 lines]
>
> Is this possible to do - Thank you for your assistance.

I assume this is a MultiSelect list box, also that the control on the
form is unbound.
You can use a command button, but I would use the Exit event of the
list box.

Private Sub ListName_Exit(Cancel As Integer)
Dim varItem As Variant
For Each varItem In ListNamet.ItemsSelected
   SomeControl = SomeControl & ListName.ItemData(varItem) & ", "
Next varItem
    SomeControl = Left(SomeControl,Len(SomeControl)-2)
End Sub

The above will display as
Red, Green, Blue

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.