General information
Category:
Coding, syntax & commands
>Im using a listbox on a modal form to return a value to a
>calling form and it isnt working.
There are several easy ways:
1. If the Tag or Comment fields of the form are not going to be used, use one of them to hold the value:
In ListBox.DoubleClick: Thisform.Tag=This.List(This.ListIndex), or even simpler: Thisform.Tag=This.Value
In myForm.Unload: Return This.Tag
2. Create a new form property (i.e., "myProp").
In ListBox.DoubleClick: Thisform.myProp=This.List(This.ListIndex), or even simpler: Thisform.myProp=This.Value
In myForm.Unload: Return This.myProp
3. Declare a memory variable before DOing the form, initialize it to an empty string, and use the memory variable as the ControlSource for the Listbox. For future reference, with this technique the form doesn't have to be modal.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only