alias of qry

Startbeitrag von RdJ am 10.01.2015 18:00


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
but I cannot find it in my 'selectable items' when I am in the 'content tab' of my combo box.


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.;)

von DerekT - am 10.01.2015 19:28
Zur Information: hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.