I have several tables with a code and a description.
for Example:
ADM Admitted
TRN Transferred
DIS Discharged
I want a combo box where the user can enter DIS or drop down the list and
select 'Discharged'. I have an array with the codes for each of the drop
down locations.
What I cannot do is to put DIS in the exit part after the user picks
'Discharged'.
I have tried setting the cText value OnClick or OnChange. No matter what I
try, however, I always get the description ('Discharged' for example) in the
text portion of the combo box.
METHOD cb1Change/cb1OnClick( oSender, nIndex ) CLASS TForm1
::oLabel3:cText := ::cb1ret[nIndex]
::cb1:cText := ::cb1ret[nIndex]
RETURN Nil
cb1ret is the array of codes.
oLabel3 shows the correct code picked
cb1 shows the full description.
What should I do?
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
ComboBox - 2 dimensional Array
-
- Mensajes: 41
- Registrado: Vie Jul 01, 2005 11:59 pm
- ignacio
- Site Admin
- Mensajes: 9440
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
ComboBox - 2 dimensional Array
Mike,
I am not sure if I understand you correctly:
Your problem is that you want 'ADM', 'TRN' or 'DIS' on oLabel3 and in the
edit field of the Combo-box, but on the Combo-box list you only want to have
'Admitted', 'Transfered' and 'Discharged'.
Is that right? Then I am afraid is not possible, the combo-box will always
try to select one string from the aItems array.
BTW, some clues:
To automatically search & update the combo-box value when the user types in
the edit field:
METHOD Combobox1EditChange( oSender ) CLASS TForm1
oSender:SelectString( oSender:GetText() )
RETURN Nil
To also update de Label3 with the array DATA aCombo:
METHOD Combobox1EditChange( oSender ) CLASS TForm1
local nAt
oSender:SelectString( oSender:GetText() )
nAt := oSender:nIndex
::oLabel1:cText := iif( nAt > 0, ::aCombo[nAt], "" )
RETURN Nil
Regards,
"Mike Draper" <draperm@cogeco.ca> escribió en el mensaje
news:[email=42b0e66b@ozsrvnegro.ozlan.local...]42b0e66b@ozsrvnegro.ozlan.local...[/email]
>I have several tables with a code and a description.
>
> for Example:
>
> ADM Admitted
> TRN Transferred
> DIS Discharged
>
> I want a combo box where the user can enter DIS or drop down the list and
> select 'Discharged'. I have an array with the codes for each of the drop
> down locations.
>
> What I cannot do is to put DIS in the exit part after the user picks
> 'Discharged'.
>
> I have tried setting the cText value OnClick or OnChange. No matter what
> I try, however, I always get the description ('Discharged' for example) in
> the text portion of the combo box.
>
> METHOD cb1Change/cb1OnClick( oSender, nIndex ) CLASS TForm1
> ::oLabel3:cText := ::cb1ret[nIndex]
> ::cb1:cText := ::cb1ret[nIndex]
> RETURN Nil
>
> cb1ret is the array of codes.
> oLabel3 shows the correct code picked
> cb1 shows the full description.
>
> What should I do?
>
>
I am not sure if I understand you correctly:
Your problem is that you want 'ADM', 'TRN' or 'DIS' on oLabel3 and in the
edit field of the Combo-box, but on the Combo-box list you only want to have
'Admitted', 'Transfered' and 'Discharged'.
Is that right? Then I am afraid is not possible, the combo-box will always
try to select one string from the aItems array.
BTW, some clues:
To automatically search & update the combo-box value when the user types in
the edit field:
METHOD Combobox1EditChange( oSender ) CLASS TForm1
oSender:SelectString( oSender:GetText() )
RETURN Nil
To also update de Label3 with the array DATA aCombo:
METHOD Combobox1EditChange( oSender ) CLASS TForm1
local nAt
oSender:SelectString( oSender:GetText() )
nAt := oSender:nIndex
::oLabel1:cText := iif( nAt > 0, ::aCombo[nAt], "" )
RETURN Nil
Regards,
"Mike Draper" <draperm@cogeco.ca> escribió en el mensaje
news:[email=42b0e66b@ozsrvnegro.ozlan.local...]42b0e66b@ozsrvnegro.ozlan.local...[/email]
>I have several tables with a code and a description.
>
> for Example:
>
> ADM Admitted
> TRN Transferred
> DIS Discharged
>
> I want a combo box where the user can enter DIS or drop down the list and
> select 'Discharged'. I have an array with the codes for each of the drop
> down locations.
>
> What I cannot do is to put DIS in the exit part after the user picks
> 'Discharged'.
>
> I have tried setting the cText value OnClick or OnChange. No matter what
> I try, however, I always get the description ('Discharged' for example) in
> the text portion of the combo box.
>
> METHOD cb1Change/cb1OnClick( oSender, nIndex ) CLASS TForm1
> ::oLabel3:cText := ::cb1ret[nIndex]
> ::cb1:cText := ::cb1ret[nIndex]
> RETURN Nil
>
> cb1ret is the array of codes.
> oLabel3 shows the correct code picked
> cb1 shows the full description.
>
> What should I do?
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
-
- Mensajes: 41
- Registrado: Vie Jul 01, 2005 11:59 pm
ComboBox - 2 dimensional Array
Ignacio
It almosts works. If I create a button with the OnClick code of:
::cb1:cText := ::cb1ret[::cb1:nIndex]
and click after making the combobox selection, it puts the code (DIS) in the
edit control.
It just does not do it when I put the same statement in a combobox event.
Or at least, I have not found the correct event. Is there an event AFTER
the control fills the edit part
where I can insert the statement?
"Ignacio Ortiz de Zúñiga" <InvalidAccount@ozs.com> wrote in message
news:42b145c4$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
> Mike,
>
> I am not sure if I understand you correctly:
>
> Your problem is that you want 'ADM', 'TRN' or 'DIS' on oLabel3 and in the
> edit field of the Combo-box, but on the Combo-box list you only want to
> have 'Admitted', 'Transfered' and 'Discharged'.
>
> Is that right? Then I am afraid is not possible, the combo-box will always
> try to select one string from the aItems array.
>
> BTW, some clues:
>
> To automatically search & update the combo-box value when the user types
> in the edit field:
>
> METHOD Combobox1EditChange( oSender ) CLASS TForm1
>
> oSender:SelectString( oSender:GetText() )
>
> RETURN Nil
>
> To also update de Label3 with the array DATA aCombo:
>
> METHOD Combobox1EditChange( oSender ) CLASS TForm1
>
> local nAt
>
> oSender:SelectString( oSender:GetText() )
>
> nAt := oSender:nIndex
>
> ::oLabel1:cText := iif( nAt > 0, ::aCombo[nAt], "" )
>
> RETURN Nil
>
> Regards,
>
> "Mike Draper" <draperm@cogeco.ca> escribió en el mensaje
> news:[email=42b0e66b@ozsrvnegro.ozlan.local...]42b0e66b@ozsrvnegro.ozlan.local...[/email]
>>I have several tables with a code and a description.
>>
>> for Example:
>>
>> ADM Admitted
>> TRN Transferred
>> DIS Discharged
>>
>> I want a combo box where the user can enter DIS or drop down the list and
>> select 'Discharged'. I have an array with the codes for each of the drop
>> down locations.
>>
>> What I cannot do is to put DIS in the exit part after the user picks
>> 'Discharged'.
>>
>> I have tried setting the cText value OnClick or OnChange. No matter what
>> I try, however, I always get the description ('Discharged' for example)
>> in the text portion of the combo box.
>>
>> METHOD cb1Change/cb1OnClick( oSender, nIndex ) CLASS TForm1
>> ::oLabel3:cText := ::cb1ret[nIndex]
>> ::cb1:cText := ::cb1ret[nIndex]
>> RETURN Nil
>>
>> cb1ret is the array of codes.
>> oLabel3 shows the correct code picked
>> cb1 shows the full description.
>>
>> What should I do?
>>
>>
>
>
It almosts works. If I create a button with the OnClick code of:
::cb1:cText := ::cb1ret[::cb1:nIndex]
and click after making the combobox selection, it puts the code (DIS) in the
edit control.
It just does not do it when I put the same statement in a combobox event.
Or at least, I have not found the correct event. Is there an event AFTER
the control fills the edit part
where I can insert the statement?
"Ignacio Ortiz de Zúñiga" <InvalidAccount@ozs.com> wrote in message
news:42b145c4$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
> Mike,
>
> I am not sure if I understand you correctly:
>
> Your problem is that you want 'ADM', 'TRN' or 'DIS' on oLabel3 and in the
> edit field of the Combo-box, but on the Combo-box list you only want to
> have 'Admitted', 'Transfered' and 'Discharged'.
>
> Is that right? Then I am afraid is not possible, the combo-box will always
> try to select one string from the aItems array.
>
> BTW, some clues:
>
> To automatically search & update the combo-box value when the user types
> in the edit field:
>
> METHOD Combobox1EditChange( oSender ) CLASS TForm1
>
> oSender:SelectString( oSender:GetText() )
>
> RETURN Nil
>
> To also update de Label3 with the array DATA aCombo:
>
> METHOD Combobox1EditChange( oSender ) CLASS TForm1
>
> local nAt
>
> oSender:SelectString( oSender:GetText() )
>
> nAt := oSender:nIndex
>
> ::oLabel1:cText := iif( nAt > 0, ::aCombo[nAt], "" )
>
> RETURN Nil
>
> Regards,
>
> "Mike Draper" <draperm@cogeco.ca> escribió en el mensaje
> news:[email=42b0e66b@ozsrvnegro.ozlan.local...]42b0e66b@ozsrvnegro.ozlan.local...[/email]
>>I have several tables with a code and a description.
>>
>> for Example:
>>
>> ADM Admitted
>> TRN Transferred
>> DIS Discharged
>>
>> I want a combo box where the user can enter DIS or drop down the list and
>> select 'Discharged'. I have an array with the codes for each of the drop
>> down locations.
>>
>> What I cannot do is to put DIS in the exit part after the user picks
>> 'Discharged'.
>>
>> I have tried setting the cText value OnClick or OnChange. No matter what
>> I try, however, I always get the description ('Discharged' for example)
>> in the text portion of the combo box.
>>
>> METHOD cb1Change/cb1OnClick( oSender, nIndex ) CLASS TForm1
>> ::oLabel3:cText := ::cb1ret[nIndex]
>> ::cb1:cText := ::cb1ret[nIndex]
>> RETURN Nil
>>
>> cb1ret is the array of codes.
>> oLabel3 shows the correct code picked
>> cb1 shows the full description.
>>
>> What should I do?
>>
>>
>
>