FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ayuda DBCOMBO
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Ayuda DBCOMBO
Posted: Thu May 11, 2023 05:52 PM
Hola Amigos

Tengo un problema.

Estoy usando un DBCOMBO, siempre que ingreso a el, este se poseciona con un registro en blanco al inicio de la lista.

Siempre la variable trae un valor que corresponde a un registro de la base, quiero saber si existe la posibilidad de que la lista del DbCombobox se encuentre ubicada el registro que corresponde al valor que trae la variable.

Desde ya muchas gracias.

Saludos

Antonio

Codigo:
Code (fw): Select all Collapse
        Abre_dbf("especia",2,.f.,"Espe")
        Set Inde To especia
        DbSetOrder(1) // 
        Database oEspe

** Por Ejemplo la variable Get33 = "MEDI"
        @ 82,300 DBCOMBO oGet33 var Get33 FONT oFont7 of oDlg2;
      alias oEspe:cAlias;
      size 200,210 pixel;
      itemfield "Cod_Esp";
      listfield "Nom_Esp";
      update  ON CHANGE   (Tipo_Espe(Get33),oNom_Esp3:VARPUT( Espe->Nom_Esp ),Nom_Esp:=Espe->Nom_Esp,Get3:=Get33,oGet3:Refresh(),oNom_Esp3:Show(),oGet33:Hide(), oGet33:Refresh(),oNom_Esp3:Refresh())
FWH 22.10 - HARBOUR - PELLES C
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: Ayuda DbCombox
Posted: Thu May 11, 2023 05:57 PM

please add the NOBLANK clause, first chek in dbcombo.ch if this version of class have the clause NOBLANK.

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 851
Joined: Sun Nov 09, 2014 05:01 PM
Re: Ayuda DBCOMBO
Posted: Thu May 11, 2023 06:04 PM

Asegurate que la variable get33 tenga la misma longuitud que el campo nom_esp

"Los errores en programación, siempre están entre la silla y el teclado..."



Fwh 19.06 32 bits + Harbour 3.2 + Borland 7.4 + MariaDB + TDolphin



Carora, Estado Lara, Venezuela.
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda DBCOMBO
Posted: Fri May 12, 2023 01:43 PM
JoseAlvarez wrote:Asegurate que la variable get33 tenga la misma longuitud que el campo nom_esp
Hola Jose

Muchas gracias por responder.

El Get33 del DbCombo, contiene el codigo de la especialidad, que es el que uso para guardar, mientras que la lista que muestra corresponde a la descripcion.
itemfield "Cod_Esp";
listfield "Nom_Esp";

Muchas gracias.

Saludos.

Antonio
FWH 22.10 - HARBOUR - PELLES C
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda DbCombox
Posted: Fri May 12, 2023 01:48 PM
carlos vargas wrote:please add the NOBLANK clause, first chek in dbcombo.ch if this version of class have the clause NOBLANK.
Hola Carlos

Muchas gracias por responder.

La version que tengo de FWH es la 22.10 y este es el DbCombo.ch que trae.

Muchas gracias

Saludos
Antonio

DbCombo.ch
Code (fw): Select all Collapse
*********************************************************************
* File Name:    DBCombo.ch
* Author:   Elliott Whitticar
* Created:  04/23/96
* Description:  Preprocessor directives for TDBCombo class.
*********************************************************************
#ifndef _DBCOMBO_CH
#define _DBCOMBO_CH

/*----------------------------------------------------------------------------//
!short: DBCOMBO */

#xcommand @ <nRow>, <nCol> DBCOMBO [ <oCbx> VAR ] <cVar> ;
             [ ITEMS <aItems> ] ;
             [ SIZE <nWidth>, <nHeight> ] ;
             [ <dlg:OF,WINDOW,DIALOG> <oWnd> ] ;
             [ <help:HELPID, HELP ID> <nHelpId> ] ;
             [ ON CHANGE <uChange> ] ;
             [ VALID <uValid> ] ;
             [ <color: COLOR,COLORS> <nClrText> [,<nClrBack>] ] ;
             [ <pixel: PIXEL> ] ;
             [ FONT <oFont> ] ;
             [ <update: UPDATE> ] ;
             [ MESSAGE <cMsg> ] ;
             [ WHEN <uWhen> ] ;
             [ <design: DESIGN> ] ;
             [ BITMAPS <acBitmaps> ] ;
             [ ON DRAWITEM <uBmpSelect> ] ;
             [ ALIAS <cAlias> ] ;
             [ ITEMFIELD <cFldItem> ] ;
             [ LISTFIELD <cFldList> ] ;
             [ <list: LIST, PROMPTS> <aList> ] ;
             [ <noblank: NOBLANK>] ;
             [ HEIGHTGET <nHGet> ] ;
       => ;
          [ <oCbx> := ] TDBCombo():New( <nRow>, <nCol>, bSETGET(<cVar>),;
             <aItems>, <nWidth>, <nHeight>, <oWnd>, <nHelpId>,;
             [{|Self|<uChange>}], <{uValid}>, <nClrText>, <nClrBack>,;
             <.pixel.>, <oFont>, <cMsg>, <.update.>, <{uWhen}>,;
             <.design.>, <acBitmaps>, [{|nItem|<uBmpSelect>}], ;
             <cAlias>, <(cFldItem)>, <(cFldList)>, <aList>, <nHGet> )

#xcommand REDEFINE DBCOMBO [ <oCbx> VAR ] <cVar> ;
             [ <items: ITEMS> <aItems> ] ;
             [ ID <nId> ] ;
             [ <dlg:OF,WINDOW,DIALOG> <oWnd> ] ;
             [ <help:HELPID, HELP ID> <nHelpId> ] ;
             [ ON CHANGE <uChange> ] ;
             [ VALID   <uValid> ] ;
             [ <color: COLOR,COLORS> <nClrText> [,<nClrBack>] ] ;
             [ <update: UPDATE> ] ;
             [ MESSAGE <cMsg> ] ;
             [ WHEN <uWhen> ] ;
             [ BITMAPS <acBitmaps> ] ;
             [ ON DRAWITEM <uBmpSelect> ] ;
             [ ALIAS <cAlias> ] ;
             [ ITEMFIELD <cFldItem> ] ;
             [ LISTFIELD <cFldList> ] ;
             [ <list: LIST, PROMPTS> <aList> ] ;
       => ;
          [ <oCbx> := ] TDBCombo():ReDefine( <nId>, bSETGET(<cVar>),;
             <aItems>, <oWnd>, <nHelpId>, <{uValid}>, [{|Self|<uChange>}],;
             <nClrText>, <nClrBack>, <cMsg>, <.update.>, <{uWhen}>,;
             <acBitmaps>, [{|nItem|<uBmpSelect>}], ;
             <cAlias>, <(cFldItem)>, <(cFldList)>, <aList> )

#endif
FWH 22.10 - HARBOUR - PELLES C
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Ayuda DBCOMBO
Posted: Fri May 12, 2023 02:41 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Ayuda DBCOMBO
Posted: Fri May 12, 2023 03:16 PM

Hola João

Muchas gracias por responder.

Trate de aplicar su solucion, pero no di con un resultado positivo.

Saludos.

Antonio

FWH 22.10 - HARBOUR - PELLES C
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Ayuda DBCOMBO
Posted: Fri May 12, 2023 03:33 PM

Haga un ejemplo práctico con el .DBF y .RAR todo para pruebas, ok?

Regardsm saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion