Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid con ayuda

Status
Not open for further replies.

hdam

Programmer
Oct 28, 2001
30
AR
Quisiera saber si alguien puede explicarme al menos este problema:

En el valid de un cuadro de texto pongo una condición por la cual si el campo ingresado viene en blanco abro otro formulario que posee un grid en donde muestro código y descripción de una tabla, permito buscar por código o por descripción y el presionar <enter> traigo el código correspondiente.

Anda muy bien y se parece bastante a lo que he hecho en programación Clipper.

Ahora ese mismo valid en un cuadro de texto DENTRO DE UN GRID.

Utilizo exactamente las mismas instrucciones. Deshabilito el formulario actual, y hago un

DO FORM BUSCO TO THIS.CUENTA (por ejemplo)

Lo mismo que aisladamente funciona bien dentro del grid ¡¡¡NO REACCIONA!!! Muestra la tabla igual pero no se mueve. Pareciera no procesarse el método keypressed del formulario invocado pero sí lo hace porque cuando doy <ENTER> retorna el primera valor de la tabla.

¿Alguien puede decirme si es posible realizar con éxito esto que intento dentro de un grid y en ese caso, adónde cuernos me estoy equivocando?

Muchas gracias.

Daniel
 
I am using the to translate so I hope I got it right. From the way I read your question, maybe you could use a drop-down combo list in the text box field instead of a grid. Or maybe you are using your code in the grid itself instead of the textbox control within the grid.
Click on the grid and from the properties list select Text1 for the column you want to activate. Then put your code in maybe the Keypress Event to get it to fire.

IF nKeyCode = 13 &&... <enter>
DO selectitemform
ELSE
DODEFAULT()
ENDIF

Dave S.
 
Daniel:

Algunas veces me ha sucedido que me paso &quot;HORAS&quot; tratando de hacer que un control u objeto funcione y me doy cuenta que accidentalmente e puesto la propiedad ENABLED del control en .f.
Podes enviar una muestra de tu codigo y de tus tablas?

rianeiromiron@yahoo.com

Suerte
 
If I understand your problem correctly, it sounds like your form is immediately returning. Try this:
Code:
GRID.COLUMN.TEXTBOX.KEYPRESS event:

LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode=13
	NODEFAULT
	DO FORM BUSCO TO THIS.CUENTA
ENDIF
The NODEFAULT will prevent FoxPro from passing your ENTER key along to the new form, which would cause it to immediately return.

------------------------------------------------------------
I'm going to run the above through the Spanish translator and see how it turns out:

Si entiendo su problema correctamente, suena como su forma está volviendo inmediatamente. Intente esto:
Code:
GRID.COLUMN.TEXTBOX.KEYPRESS event:

LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode=13
	NODEFAULT
	DO FORM BUSCO TO THIS.CUENTA
ENDIF
El NODEFAULT evitará que FoxPro pase su ENTER clave adelante a la nueva forma, que lo haría volver inmediatamente.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top