Los combobox no funcionan bien con tipo de datos integer

43 views
Skip to first unread message

ZeRoberto

unread,
Apr 12, 2012, 6:24:49 PM4/12/12
to publicesvfoxpro
Estuve haciendo pruebas y no me funcionaron, ahora que hago defini todos mis codigo como integer autonumericos
 
Aca dejo un formulario para que lo revisen
 
Saludos
Test.r4r

Walter R. Ojeda Valiente

unread,
Apr 12, 2012, 6:25:57 PM4/12/12
to publice...@googlegroups.com
¿Hmmmmmmmmm?

Pues estarás haciendo algo mal, a mí siempre me funcionaron de lo más bien.

Saludos.

Walter.





Date: Thu, 12 Apr 2012 17:24:49 -0500
Subject: [vfp] Los combobox no funcionan bien con tipo de datos integer
From: zero...@gmail.com
To: publice...@googlegroups.com

ZeRoberto

unread,
Apr 12, 2012, 6:33:50 PM4/12/12
to publice...@googlegroups.com
Hola Walter no se si estare haciendo algo mal, pero lo estoy tratando de usar como lo hacia con los dbf, el problema es que ahora tuve que cambiar los campos codigos por Integer AutoIncrement, para evitar hacerlos en texto como en los dbf, pero ahora cuando coloco un numero no me encuentra el codigo, no se si el numerlo lo tenga que castear a integer.
 
Saludos
 
PD.- Ahi les deje un codigo, y un archivo sql para que monten las tablas
 
Saludos nuevamente

Mario López

unread,
Apr 12, 2012, 8:12:53 PM4/12/12
to Comunidad de Visual Foxpro en Español
@ZeRoberto:

seguro que tenés seteada en .F. la propiedad BoundTo del ComboBox, el
help no es muy
descriptivo sobre eso, en cambio HackFox sí:

---
The Value of combos and lists in Visual FoxPro can be either numeric
or character. When the Value of a list or combo is initialized to a
number or the ControlSource is numeric, by default, the position
(Index) of the chosen item is stored. Even if the BoundColumn contains
numeric data, it's the Index that gets stored.

However, lists and combos have the ability to draw their Value from a
different field than the first one displayed and, in fact, to draw
their Value from a column that isn't even displayed. This makes it
possible to display a list of items, but store the unique IDs of those
items. If you're using numeric (say, Integer) IDs, though, the default
behavior of lists and combos presents a problem.

Enter BoundTo. If this property is set to .T., the actual numeric data
is stored if both Value/ControlSource and the column referenced by
BoundColumn are numeric. Leave BoundTo at .F. and you get the Index.
If the column referenced by BoundColumn isn't numeric, but Value/
ControlSource are, the Index is stored. If Value/ControlSource are
character, then the content of the bound column is stored, as usual.
---

HTH
Mario

---

On Apr 12, 7:33 pm, ZeRoberto <zeroha...@gmail.com> wrote:
> Hola Walter no se si estare haciendo algo mal, pero lo estoy tratando de
> usar como lo hacia con los dbf, el problema es que ahora tuve que cambiar
> los campos codigos por Integer AutoIncrement, para evitar hacerlos en texto
> como en los dbf, pero ahora cuando coloco un numero no me encuentra el
> codigo, no se si el numerlo lo tenga que castear a integer.
>
> Saludos
>
> PD.- Ahi les deje un codigo, y un archivo sql para que monten las tablas
>
> Saludos nuevamente
>
> El 12 de abril de 2012 17:25, Walter R. Ojeda Valiente
> <w...@hotmail.com>escribió:
>
>
>
>
>
>
>
> >  ¿Hmmmmmmmmm?
>
> > Pues estarás haciendo algo mal, a mí siempre me funcionaron de lo más bien.
>
> > Saludos.
>
> > Walter.
>
> >  ------------------------------
> > Date: Thu, 12 Apr 2012 17:24:49 -0500
> > Subject: [vfp] Los combobox no funcionan bien con tipo de datos integer
> > From: zeroha...@gmail.com

ZeRoberto

unread,
Apr 12, 2012, 9:48:29 PM4/12/12
to publice...@googlegroups.com
Hola Mario ahi adjunte un formulario para que lo revisen y me den
algunos datos, si es que lo estoy haciendo mal.

Saludos y gracias por contestar

2012/4/12, Mario López <guag...@gmail.com>:

Alan Cybar

unread,
Apr 13, 2012, 8:03:40 AM4/13/12
to publice...@googlegroups.com
En el script sql que adjuntaste al hacer el insert en la tabla1 tienes el NumeroID de tipo integer y le haces el insert de tipo texto o character.
Otro punto, en el form que enviaste e el Rowsource colocas lo sigte: dbLista1.NumeroTexto,NumeroID.

Te sugiero que coloques de la siquiente manera: dbLista1.NumeroTexto + " - " + dbLista1.NumeroID

Saludos

Alan Sanier

2012/4/12 ZeRoberto <zero...@gmail.com>
Reply all
Reply to author
Forward
0 new messages