Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 8 Jahren, 1 Monat
Letzter Beitrag:
vor 8 Jahren, 1 Monat
Beteiligte Autoren:
Joel, Jeff Graham, Milton, Piet van Zanten

WB12 - Programmably changing what query a combo uses

Startbeitrag von Joel am 23.08.2009 01:26

Hi all -

I have been trying to get a combo box to change which query it uses to display its data - but no luck so far. Here's the code I've been trying so far - any ideas?

IF gpgpar_EventType = "Event" THEN
STA_Title..Value = "Add an Event..."
CMB_EventsList..Caption = "Select an Event"
CMB_EventsList..BrowsedFile = "Qry_ListItems_EventIsNotTest"
CMB_EventsList..DisplayedItem = Qry_ListItems_EventIsNotTest.sListItemCustom

ELSE
STA_Title..Value = "Add a Test Event..."
CMB_EventsList..Caption = "Select a test Type"
//HExecuteQuery(Qry_ListItems_EventsIsTest)
CMB_EventsList..BrowsedFile ="Qry_ListItems_EventsIsTest"
CMB_EventsList..DisplayedItem = Qry_ListItems_EventsIsTest.sListItemCustom
EDT_CyEventPrice..Visible = False
CHX_BTaxable..Visible = False
EDT_I4Capacity..Visible = False
CMB_IncomeCategories..Visible = False
END

I put this code in the init section of the page, and I have tried not putting quotes qround the query name - it just throws an error.

Any comments appreciated.

Antworten:

Joel,

I f I understand what you are trying to do I think you may have the wrong approach. The combo box is built on a query so that it should always be linked to that query. If you want to display two sets of data conditionally I would use two combo boxes, one populated by your "istest" query and another populated by your "isnottest" query. Then simply use the conditional event to make the appropriate combo visible and the other invisible and vice versa.

HTH

Milton

von Milton - am 23.08.2009 03:14
Hi Joel,

Look at the BrowsedFile property.

Regards,
Piet

von Piet van Zanten - am 23.08.2009 08:05
Hi Joel,

You can also load the combo by executing the query and then
FOR EACH QueryName
LIstAdd(....)
END

Jeff


von Jeff Graham - am 23.08.2009 18:12
Thanks Jeff -

No that's what I was looking for!



von Joel - am 23.08.2009 21:21
Zur Information:
MySnip.de 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.