FoxPro/Visual FoxPro - busqueda multip[le

 
Vista:
sin imagen de perfil

busqueda multip[le

Publicado por Ives (21 intervenciones) el 22/10/2022 16:12:40
cuando se ingresa datos en un text box se debe buscar por nombre, identifica, direccion y telefono al dar click en el boton buscar, pero a veces no funciona bien la busqueda.

este es el codigo del boton

SELECT clientes2

IF !EMPTY(THISFORM.Text1.Value)
GO TOP
SET ORDER TO
SET ORDER TO nombre
SEEK ALLTRIM(thisform.text1.Value)
thisform.Refresh
ENDIF


IF !EMPTY(THISFORM.Text1.Value)
GO TOP
SET ORDER TO
SET ORDER TO identifica
SEEK ALLTRIM(thisform.text1.Value)
thisform.Refresh
ENDIF

IF !EMPTY(THISFORM.Text1.Value)
GO TOP
SET ORDER TO
SET ORDER TO direccion
SEEK ALLTRIM(thisform.text1.Value)
thisform.Refresh
ENDIF

IF !EMPTY(THISFORM.Text1.Value)
GO TOP
SET ORDER TO
SET ORDER TO telefono
SEEK ALLTRIM(thisform.text1.Value)
thisform.Refresh
ENDIF
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 309
Bronce
Ha mantenido su posición en FoxPro/Visual FoxPro (en relación al último mes)
Gráfica de FoxPro/Visual FoxPro

busqueda multip[le

Publicado por santiago scheppmann (551 intervenciones) el 22/10/2022 17:25:52
Hola, es que no estas indicando el indice asociado.

si es un indice simple :
SELECT clientes2 index nom_ind && nom_ind es el archivo indice ordenado por nombre
SELECT clientes2 index ide_ind && ide_ide es el archivo indice ordenado por identifica
SELECT clientes2 index dir_ind && dir_ide es el archivo indice ordenado por direccion
SELECT clientes2 index tel_ind && tel_ide es el archivo indice ordenado por telefono

si es un indice compuesto :
SELECT clientes2 index unico_ind tag && uni_ind (si mal no recuerdo)
set orde to 1
SELECT clientes2 index unico_ind tag && uni_ind (si mal no recuerdo)
set orde to 2
SELECT clientes2 index unico_ind tag && uni_ind (si mal no recuerdo)
set orde to 3
SELECT clientes2 index unico_ind tag && uni_ind (si mal no recuerdo)
set orde to 4

ambos se veran afectados por :
set exact on/off
si es on solo mostrara el dato exacto
si es off mostrara el dato mas aproximado
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de Mauricio Antonio
Val: 471
Plata
Ha mantenido su posición en FoxPro/Visual FoxPro (en relación al último mes)
Gráfica de FoxPro/Visual FoxPro

busqueda multip[le

Publicado por Mauricio Antonio (1541 intervenciones) el 23/10/2022 12:48:41
parece que algunas veces funciona y otras no. Puede ser a que cuando no funciona, en realidad si funciona, pero el campo a buscar no existe, por ejemplo:
IF !EMPTY(THISFORM.Text1.Value)
GO TOP
SET ORDER TO
SET ORDER TO telefono
IF SEEK ALLTRIM(thisform.text1.Value)
thisform.Refresh
ELSE
messagebox('Registro no existe ' + ' ' + THISFORM.Text1.Value
endif
ENDIF
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar