This topic is locked

little help with mini application

7/9/2009 11:01:18 PM
ASPRunnerPro General questions
F
FNMever author

Dear support:
First, sorry me about my basic english
I´m already finishing a little application, who registers many pacients and his medical session and subsequents controls, but I confused with this situation.
The design of my DB is:

TABLE PACIENTS:

Rut (PK)

Name

others fields...
TABLE SESSIONS:

RUT (PK)

Session_number (PK)

others fields...
TABLE CONTROL:

RUT (PK)

Control_number (PK)

other fields...
My problem is, when I add a session or control, I need to write the next session or control number, corresponding by the order (ex. RUT 1, session 1, when I add another session, the array needs to be RUT 1, session 2)
My application is hosted in: http://demo.asprunner.net/redespc%5Fsoftho...ra%5F2/menu.asp
I expect to understand me and my bad english, because your help is so important to finish this software
Thanks in advance

J
Jane 7/10/2009

Hi,
select latest Numer_de_sesion from Sesiones table in the Add page: Before process event on the Events tab, calculate new value and save it in the session variable.

Here is a sample:

set rstmp = dal.Sesiones.Query("RUT=" & session(strTableName & "_masterkey1"), "Numero_de_Sesion desc")

if not rstmp.eof then

Session("Numero_de_Sesion") = rstmp("Numero_de_Sesion")+1

else

Session("Numero_de_Sesion") = 1

end if

rstmp.close

set rstmp=nothing



Then use Session("Numero_de_Sesion") as default value for Numero De Sesion field on the "Edit as" settings dialog on the Visual Editor tab.

F
FNMever author 7/14/2009

Hi,

select latest Numer_de_sesion from Sesiones table in the Add page: Before process event on the Events tab, calculate new value and save it in the session variable.

Here is a sample:
Then use Session("Numero_de_Sesion") as default value for Numero De Sesion field on the "Edit as" settings dialog on the Visual Editor tab.


Thanks Jane!
That´s works for both session and controles !!!
I appreciate your help

F
FNMever author 8/27/2009



Hi,
select latest Numer_de_sesion from Sesiones table in the <b>Add page: Before process</b> event on the <b>Events</b> tab, calculate new value and save it in the session variable.

Here is a sample:

<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->set rstmp = dal.Sesiones.Query("RUT=" & session(strTableName & "_masterkey1"), "Numero_de_Sesion desc")
if not rstmp.eof then

Session("Numero_de_Sesion") = rstmp("Numero_de_Sesion")+1

else

Session("Numero_de_Sesion") = 1

end if

rstmp.close

set rstmp=nothing<!--QuoteEnd--></div><!--QuoteEEnd-->

Then use Session("Numero_de_Sesion") as default value for Numero De Sesion field on the <b>"Edit as" settings</b> dialog on the <b>Visual Editor</b> tab.


Hi Jane
I know I was told that this code works with "Controles" table too, but it isn`t
The idea is the same .. control correlative number when each "control" is added
Can you help me? The aapp is at http://demo.asprunner.net/redespc%5Fsofthome%5Fnet/acupuntura%5F2/Pacientes_list.asp
Thanks in advance

J
Jane 8/28/2009

Hi,
you've just forgot to replace table name in your code:

set rstmp = dal.Controles.Query("RUT=" & session(strTableName & "_masterkey1"), "Numero_de_Control desc")
if not rstmp.eof then

Session("Numero_de_Control") = rstmp("Numero_de_Control")+1

else

Session("Numero_de_Control") = 1

end if

rstmp.close

set rstmp=nothing