Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 7 Jahren, 4 Monaten
Letzter Beitrag:
vor 7 Jahren, 4 Monaten
Beteiligte Autoren:
Michael Q, Paulo Oliveira

WD15: How to select new record in a combo?

Startbeitrag von Michael Q am 07.02.2011 16:44

I can't seem to get my head around how to do this and would really appreciate some help.

I have a Combo CMB_Traveller in which the displayed item is "Name", but the stored item is TravellerID. I have a first custom row "New Traveller" which when selected will open a window to add a new traveller. After the traveller has been added, the window is closed and focus returns to the CMB_Traveller. What I want is for the new traveller to now be shown in the combo selection box. At the moment, the code below updates the combo to include the new traveller as an option, but it still shows "New Traveller" in the selection box.

It seems that the problem has 2 parts:
1. Record the TravellerID of the newly created Traveller.
2. Make the name of that traveller appear in the selection box of the combo.

I'd be really grateful for any guidance on how to do #1 & #2.

Many thanks
Michael

-----------------
Row Selection of CMB_Traveller

IF CMB_Traveller..StoredValue = "NewTraveller" THEN
// Create a new record
HReset(Traveller)

// Open the form of Traveller file in creation mode
IF Open(WIN_Form_Traveller) THEN

// Refresh the combo
ListDisplay(CMB_Traveller)
END
END

Antworten:

The way of doing it can be different depending on linked to a file or not.try with one of the above:
ListDisplay(CMB_Traveller,taCurrentFirst)
or use
ListSelectPlus


von Paulo Oliveira - am 07.02.2011 19:17
Thanks Paulo,

ListDisplay(CMB_Traveller,taCurrentFirst) did the trick. (taCurrentFirst was the part that was missing).

Michael

von Michael Q - am 08.02.2011 11:29
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.