making values global within a form

B

Bill

I have create a list which the user should select a value
from. From that a series of command will run after the
user clicks a command button. i want VB to check to make
sure a value has been select and that it is Null or
Empty. However even after selecting a value in the list
box, within the Private Sub Command7_Click() code the
value is still empty. how do i make the listbox value
global? Thank
 
L

losmac

Hi Bill,

Which column is bounded field in listbox?

Here is an example for column 1
Private Sub Command7_Click()

If IsEmpty(Me.ListBox1.Column(0,Me.ListBox1.listIndex)) _
Or IsNull(Me.ListBox1.Column(0,Me.ListBox1.listIndex))
Then Exit Sub

MsgBox Me.ListBox1.Column(0,Me.ListBox1.listIndex)

'here other instructions

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top