|
FOROS PROFESIONALES WINDEV, WEBDEV y WINDEV Mobile |
| | | | | |
| Iniciado por guest, 10,ene. 2015 19:00 - 1 respuesta |
| |
| | | |
|
| |
| Publicado el 10,enero 2015 - 19:00 |
hi,
I would like to use an alias of a qry in a combo box but how do I do this without 'programming' the values. The idea is to use this alias as I would use a normal qry in combo box. The reason I want to do this is because I have 2 combo boxes on the same screen that need to be filled with the same info but when I use the same qry this doesn't work therefor i would like to use this alias. (this qry is not a simple browse of the table so this is not going to work. I can offcourse the qry again with a new name but that means that I need to maintain 2 qry's instead of 1 when something changes)
I defined the following as global //define global data sources for the use in queries GQRY_ComboBoxTasks is Data Source HAlias(QRY_TasksForComboListAll,GQRY_ComboBoxTasks) but I cannot find it in my 'selectable items' when I am in the 'content tab' of my combo box. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 10,enero 2015 - 20:28 |
Use variables
Declare a structure with members equal to the values returned by the query.
Set 2 variables - Comb1 is an array of 'structure', Combo2 is an array of 'structure' Use the variables as the content of the combos.
Execute your query and populate each array with FileToArray() Then run ListSelect() for both combos.
If you are using the combos in 'standard fashion' - returning a single value on selection you are good to go.
You will have the advantage of storing and being able to recover all columns of your query if you so require. This does however require more work and a different approach when reading the selected combo row.
Of course it may well be easier to have 2 queries.<img src="/NG2013_WEB/ui/smiley/6.gif" align=absmiddle border=0 alt=";)"> |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|