I have a list of customers i would like to enable if ans when needed. When checked i would like the string to return who i have selected.. can anyone tell me the best option to use in VB.?
Printable View
I have a list of customers i would like to enable if ans when needed. When checked i would like the string to return who i have selected.. can anyone tell me the best option to use in VB.?
Hi there gsc1ugs,
What do you want ??? The code or the logic ???
Both the logic and code, you should specify more I think. Because, I only got this from your msg,...
You got a list, let's say like this :
- Customer I
- Customer II
- Customer III
- Customer IV
and then you have a checkbox like this...
Enable List ???
if user check the checkbox, then, the list of customer will enabled. If user uncheck the checkbox, the list of customer will disabled.
If user check the checkbox, and then choose Customer II, then there will be message / string to show that you choose customer II.
Am I right ???
If so, let me know ASAP
Cheers :p,
Wen Lie
[Edited by Wen Lie on 06-19-2000 at 06:51 AM]
Thats the ticket..!
hOW DO YOU DO THIS.. DO YOU HAVE AN EXAMPLE
In a form at design time, place the listbox and checkbox.
Let's say that the listbox name is lstBox, and the checkbox name is chkBox.
First, at form load, add your list name of customer.
Then at chkBox_Click Event, write this code :Code:Private Sub Form_Load()
For iLoop = 1 to MaxLst
lstBox.AddItem your item goes here
Next iLoop
lstBox.Enable = False
End Sub
Then at lstBox_Click Event, write your msg :Code:Private Sub chkBox_Click()
If chkBox.Value = 1 Then
lstBox.Enable = True
Else
lstBox.Enable = False
End If
End Sub
Hope will help you...Code:Private Sub lstBox_Click()
Dim Msg
'cek the index of lstBox clicked item.
'then write :
Msg = lstBox.List(lstBox.ListIndex)
End Sub
And hope will not get any error, coz I make this in sleepy eyes... :p
BRgds,
Wen Lie
This does'nt really answer my dilema.. i read from a database (i should have told you this) and if the customer read from the database is equal to the check box then do something,, thats my scenario..?
Many thanks