You are not logged in.

Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

1

Tuesday, October 16th 2012, 3:52pm

msgbox with the value of selected item of a combobox

Hi again!
I need your help please!

I have a combobox that fills with the results of a mysql query.
Is there a way to have a msgbox that appears the value of the selected item?

I mean that...
whenever i make a selection from combobox to appear a msgbox that tells ...
"your selection is..."

To help you,
as i told you i have a combobox with categories (that fills from a mysql selection) and now i am trying to take the selected value of this combobox to make another mysql selection that fills my other combobox that calls subcategories.

for example if the selected value = "x"
to make this

'sub catigories combobox
Set Data = Order.executeQuery("SELECT * FROM katigories_esod_exod WHERE subcatigories = "x" GROUP BY subkatigories ORDER BY subkatigories")
Do While Data.next()
subkatigories = Data.getString("subkatigories")
ComboBox_katigoria.AddItem New ListCellData(subkatigories, all_subkatigories, False)
Loop



thanks in advance

This post has been edited 1 times, last edit by "fomaxrge" (Oct 16th 2012, 4:25pm)


theuserbl

Intermediate

Posts: 436

Date of registration: Dec 20th 2008

  • Send private message

2

Thursday, October 18th 2012, 12:35am

RE: msgbox with the value of selected item of a combobox

Hi again!
I need your help please!

I have a combobox that fills with the results of a mysql query.
Is there a way to have a msgbox that appears the value of the selected item?

I mean that...
whenever i make a selection from combobox to appear a msgbox that tells ...
"your selection is..."


Currently I don't know where the bug is in ListData.
But currently it will help to use Parent.getItemAt instead:

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
Public Sub Form_Load()
   ComboBox1.AddItem("first entry")
   ComboBox1.AddItem("second entry")
   ComboBox1.AddItem("third entry")
   ComboBox1.AddItem("fourth entry")
   ComboBox1.AddItem("fifth entry")
   ComboBox1.AddItem("sixth entry")
   ComboBox1.AddItem("seventh entry")
End Sub

Public Sub ComboBox1_Change()
   MsgBox("your selection is " + ComboBox1.Parent.getItemAt(ComboBox1.ListIndex))
End Sub


Greatings
theuserbl

fomaxrge

Trainee

  • "fomaxrge" started this thread

Posts: 88

Date of registration: Aug 14th 2012

  • Send private message

3

Thursday, October 18th 2012, 12:51pm

combobox_change() was exactly what i was looking for.

Thank you very much for your help and for your precious time you spend on my problem too.
Have a nice day!

Rate this thread
WoltLab Burning Board