Que estoy haciendo mal? / What am I doing wrong - Forum

Forum Navigation
You need to log in to create posts and topics.

Que estoy haciendo mal? / What am I doing wrong

@asleycruz, @gaev, @vadim , @cn_iceman

ESPAÑOL

La verdad que no entindo que es lo que estoy haciendo mal

Necesito abrir una tabla de la base y reemplazar lo que contiene el registro 1 por los datos que le paso en las variables...

Pero no lo logro

yo escribi esto:

dbpOpenTable "gestion" "planilla" ""
dbpFirst "gestion" "planilla"
SetVar "[gestion.planilla.planilla]" "[gestion.usuarios.planilla]"
SetVar "[gestion.planilla.titular]" "[gestion.usuarios.titular]"
SetVar "[gestion.planilla.razonsocial]" "[gestion.usuarios.razonsocial]"
SetVar "[gestion.planilla.direccion]" "[gestion.usuarios.direccion]"
SetVar "[gestion.planilla.documento]" "[gestion.usuarios.documento]"
SetVar "[gestion.planilla.telefono]" "[gestion.usuarios.telefono]"
SetVar "[gestion.planilla.totalcuotas]" "[gestion.usuarios.totalcuotas]"
SetVar "[gestion.planilla.valorcuota]" "[gestion.usuarios.valorcuota]"
SetVar "[gestion.planilla.iniciapagos]" "![gestion.usuarios.iniciapagos]"
dbpSaveEdits "gestion" "planilla"
dbpRefresh "gestion" "planilla"

dbpPrintReport "gestion" "[pubdir]planilla_de_cobro.dbr" "PrintDialog=Yes;S

Que es lo que hago mal que las variables no se escriben en el registro 1 de la tabla?????

ENGLISH

The truth is that I do not understand what I am doing wrong I need to open a table from the base and replace what is contained in record 1 with the data that I pass in the variables ... But i can't I wrote this code 

dbpOpenTable "gestion" "planilla" ""
dbpFirst "gestion" "planilla"
SetVar "[gestion.planilla.planilla]" "[gestion.usuarios.planilla]"
SetVar "[gestion.planilla.titular]" "[gestion.usuarios.titular]"
SetVar "[gestion.planilla.razonsocial]" "[gestion.usuarios.razonsocial]"
SetVar "[gestion.planilla.direccion]" "[gestion.usuarios.direccion]"
SetVar "[gestion.planilla.documento]" "[gestion.usuarios.documento]"
SetVar "[gestion.planilla.telefono]" "[gestion.usuarios.telefono]"
SetVar "[gestion.planilla.totalcuotas]" "[gestion.usuarios.totalcuotas]"
SetVar "[gestion.planilla.valorcuota]" "[gestion.usuarios.valorcuota]"
SetVar "[gestion.planilla.iniciapagos]" "![gestion.usuarios.iniciapagos]"
dbpSaveEdits "gestion" "planilla"
dbpRefresh "gestion" "planilla"

dbpPrintReport "gestion" "[pubdir]planilla_de_cobro.dbr" "PrintDialog=Yes;S

What am I doing wrong that variables are not written to record 1 of the table ?????

 

 

@joferar333

What am I doing wrong that variables are not written to record 1 of the table ?????

1) Where are you opening the usuarios table ?

2) Before the dbpPrintReport command, temporarily insert dbpShowGrid commands so you can view the contents of ALL records in both Tables ... confirm that ...

- the record you saved is not found ANYWHERE in the planilla Table
- the current record in the usuarios Table is what you expected

If you still can not figure out the problem, create a minimalist pub (with just the neessary commands) and a .mdb file with a few test records ... and upload it here.

@joferar333

Trata de no asignarle a la variable la misma variable, ya que le indicas los mismos datos que ya contiene.
Usa al menos una variable diferente y prueba de nuevo.

SetVar "[gestion.planilla.planilla]" "Nuevo valor"

@asleycruz

Hola Asley

voy a probar como tu dices, aunque las variables si bien tienen el mismo nombre pertenecen a dos tablas diferentes dentro de la base...

Pruebo y te comento

@asleycruz,@gaev,@vadim

ESPAÑOL

No hay caso no logro poder hacer que el registro 1 y unico de base sea reemplazado por las variables.. aca un ejemplo simple del fuente

ENGLISH

There is no case, I cannot make the base register 1 and only be replaced by the variables. Here is a simple example of the source

Uploaded files:
  • You need to login to have access to uploads.

@joferar333

Pues, lo he probado con el código de abajo en un nuevo botón y modifica los datos de la tabla correctamente.
Solo revisa bien lo que haces en tu código principal.

dbpFirst "error" "planilla"
SetVar "[error.planilla.registro]" "333"
SetVar "[error.planilla.detalle]" "Detalles"
dbpSaveEdits "error" "planilla"

Vadim has reacted to this post.
Vadim

@joferar333

I need to make the content of that record first and only
be replaced by the values stored in the corresponding variables ...

setVar "[error.sheet.registration]" "12563"
SetVar "[error.formula.detail]" "this is a test ..."

In your PageEnter code section, you open the error Database and the planilla Table within it ...

dbpOpenAccessDatabase "error" "[pubdir]error.mdb" ""
dbpOpenTable "error" "planilla" ""

... but you never open the sheet and formula tables ... you can only use the afore mentioned SetVar commands AFTER you open the respective Tables ... then, the SetVar commands will update the requested fields in the CURRENTLY REFERENCED record.

Vadim has reacted to this post.
Vadim

@asleycruz

Tenias razon el problema era mio, le agregaba un registro cuando en realidad solo debia modificar y grabar la edicion...

Ahora funciona perfecto, pero aprovecho para sacarme una duda...

Yo tengo una tabla y almacena un campo que es planilla, el cual se repite en muchisimos movimientos, bien si hago una busqueda que se encuentra filtrada precisamente por ese campo (planilla - que es numerico) en la grilla al mostrarme me se posiciona y marca el primero que encuentra pero deja todos los demas en la grilla como puedo hacer para que al solicitar la busqueda de un determinado campo (ingresar el numero de planilla) solo me deje y muestre todos los registros que contengan ese numero de planilla?

Mil gracias desde ya

 

ENGLISH

I have a table and it stores a field that is a spreadsheet, which is repeated in many movements, well if I do a search that is filtered precisely by that field (spreadsheet - which is numerical) in the grid when showing me it positions and marks the first one that it finds but leaves all the others in the grid, how can I do so that when requesting a search for a certain field (enter the number of the worksheet) it only leaves me and shows all the records that contain that number of the worksheet?

@joferar333

No estoy en la PC ahora mismo, pero el plugin contiene una acción dbpQuery, revise la ayuda de esa acción ya que contiene muchos ejemplos para realizar búsquedas en la tabla y obtener los resultados deseados.