This topic is locked
[SOLVED]

 List Box and Lookup Wizard

10/11/2005 7:23:52 AM
ASPRunnerPro General questions
author

Hi Sergey,

Is there a way when using the lookup wizard to make the box so you can enter text directly as well as using the values from the dropdown box? I need this when the value needed is not in the dropdown list. Further can you then add the entered data into the dropdown box table-Probably would do this within Access?

Thanks

Jerry

Sergey Kornilov admin 10/13/2005

Jerry,
unfortunately you can not do this. However you can add one more field apart from the lookup wizard field to enter some values manually.

500335 10/15/2005

Can you explain a litle bit? This is somethig I really need. It seems to be doable.

I have seen this is done in some web pages, but it seems with asprunner we have to do it manually.

Sergey Kornilov admin 10/17/2005

Guest,
create one more field in your database for manually entered values.

500336 10/17/2005

What about creating a Combo Box and a Text Field pointing to the same filed in the table, so the users can decide from selecting the value hard to find in a huge combo box or typing & validating on the text field? is it posible? well I think the thing is how to validate the text entered if exist or is a valid entry for a column in a table. Can you give us any help!!!?

Sergey Kornilov admin 10/17/2005

I'm sure if it's gonna help or not - here is the general guideline for implementing a drop-down box with an additional text box.

  1. Display text box next to database-driven drop-down box. Make sure you give it distinctive name.
    <input type=text name=txtFieldName>


2. On the server side check this field content and if it's not empty try to find this value in lookup table

if GetRequestForm("txtFieldName")<>"" then

  set rsTemp = Server.CreateObject("ADODB.Recordset")

  rsTemp.Open "select 8 from LookupTable where DisplayName='" & GetRequestForm("txtFieldName") & "'"

  if not rsTemp.eof then

      ' record found

      ' use this record ID to insert it into the main table
  else

      ' record not found

      ' add this record to lookup table, pull new is and insert it into the main table

      ' or display an error message saying this value is not found and needs to be reentered
  end if
end if


Some time after implementing this schema you may end up with lookup tables full of all kinf of possible misspellings.

T
trblshtr 10/20/2005

I am new to asp but thios is hwat can be in access using vbscript. The only way to prevent the misspellings is to have the original table to enter the list value into. it mat be possible to pace an "add" to the list that activates the add form to the table the lookup is activated from.

500337 10/20/2005

Sorry but I get really confused with what you are saying trblshtr. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6430&image=1&table=forumreplies' class='bbc_emoticon' alt=':huh:' />
Sergey: I think it is a good solution. It will help a lot of ASPRUNNERS.
STEP 1: I think, I already figured out where to put the step 1 code but
STEP 2: I CAN'T find where to put it and how to call or invoke it.
ii)I thought it can be possible put it as ONBLUR in the input text field but don't know how accomplish it.
ii)I was thinking also that we may create a general IsExist.js (Or specific ExistContract.js, ExistID.js, ExistClient,js) functions, so we would be able to validate any field but trying to understand how to do it I got like sick... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6430&image=2&table=forumreplies' class='bbc_emoticon' alt=':(' />
I believe in my case, I am pretty close to the solution, any suggestion?
Thank you very much <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6430&image=3&table=forumreplies' class='bbc_emoticon' alt=':)' />

Sergey Kornilov admin 10/20/2005

In the beginning of add page there is a set of sections that start with

if IsUpdatable(rs.Fields("FieldName")) then


Code snippet #2 should be added to the section that belongs to this field.
ONBLUR and other Javascript events won't help you because database interaction occurs on the server side while Javascript is handled by client's browser after server part is completed.
In one of the next versions we'll add some thing similar to what is trblshtr saying. The would be an "Add new item" link next to drop-down box which invokes a popup where you can add new item and click "Save". After that new item is added to drop-down box.

500338 10/21/2005

Thanks for the answer but definitely I can not find the way by my self.

  1. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6438&image=1&table=forumreplies' class='bbc_emoticon' alt=':blink:' /> I don't know how to show the error message from the server side code stopping the save to the database, so we can ask the user to reenter that field only with something "The following fields are required" dialog box? . Forget about adding the values to the lookup table, this is much more important...
    The rest is working and is validating what ever they entered in the field against the table. Great thing <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6438&image=2&table=forumreplies' class='bbc_emoticon' alt=':D' /> .
  2. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6438&image=3&table=forumreplies' class='bbc_emoticon' alt=':huh:' /> Also I am not sure how to assign the value they entered in this field instead the drop down box value unless we can force the selection on the box after the field is validated and is right. Uff!!! is enoght for me tonight... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6438&image=4&table=forumreplies' class='bbc_emoticon' alt=':blink:' />
    Thanks for the help <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6438&image=5&table=forumreplies' class='bbc_emoticon' alt=':)' />

D
dgs 11/6/2005

I need this feature urgently too to manually allow user to enter text that is not in the Lookup List. Wouldn't it be simpler to add a textbox to the left of dropdown list? If user selects an item from the dropdown list the item is put into the textbox OR the user could just type into the textbox or modify the existing text. The textbox will be used to update the field and not the dropdown list. I don't think most of us need all the extras like adding items to the combo or even adding new records to the database.

M
mpsys 11/16/2005

I am also looking for a way to search the drop down list and add text for "other" if the selection doesn't list what a user needs. I've tried to list as "Other (please specify)" and then text over it, but it won't allow text type in a filed that is designated lookup wizard.
Please keep us posted if this will be added functionality or if there is a current working workaround.
Thanks

500339 11/16/2005

This is my solution it works almost 100%. Please find my code between '<**> and '</**>.
Sergey: This is what I did. I put a "FieldNameAux" at the right side of the DropDownBox. If the user select something in the combobox that value is taken. If nothing is selected in combobox and something is typed in the "FieldNameAux" then it is validated if exist. If validation is OK the record is saved. That way works ok.

BUT if validation is NOT OK, I show a dialog box explaining what happened then click ok and it CLEANS all the fields SO to continue without loosing it I have to CLICK BACK to correct only and not to type everything again specialy en EDIT MODE.

Please tell me what showld I do to prevent the problem and if there is an easier way to do it.

Thanks
<%@ Language=VBScript %>
<%

If Session("UserID")="" then

Session("MyURL")=request.ServerVariables("SCRIPT_NAME") & "?" & request.ServerVariables("QUERY_STRING")

Response.Redirect "login.asp?message=expired"

End If

if CheckSecurity("", "Edit")<>True Then

Response.Write "<p>" & "You don't have permissions to access this table" & "<a href=""login.asp"">" & "Back to login page" & "</a></p>"

Response.End

end if

%>
<!--#include file="include/jsvariables.asp"-->

<% Call DefineScriptMessages %>
<%
Set myRequest = CreateObject("Scripting.Dictionary")

Set myRequestFiles = CreateObject("Scripting.Dictionary")

if ParseMultiPartForm()=true then
end if
MaxSizeSet=false

%>
<html>

<link REL="stylesheet" href="include/style.css" type="text/css">

<title>Pagos Recibidos Detalle</title>
<!--#include file="include/validate.htm"-->
<!--#include file="include/tbDepositosDetalle_dbconnection.asp"-->

<!--#include file="include/tbDepositosDetalle_variables.asp"-->

<!--#include file="include/tbDepositosDetalle_aspfunctions.asp"-->

<body bgcolor=white onLoad="define('NumeroDeposito', 'IsNumericIsRequired', '<%=Label("NumeroDeposito")%>');define('NumeroDepositoDetalle', 'IsNumericIsRequired', '<%=Label("NumeroDepositoDetalle")%>');define('Monto', 'IsNumeric', '<%=Label("Monto")%>');">

<script language="JavaScript" src="include/ts_picker.js"></script>

<script language="JavaScript" src="include/jsfunctions.js"></script>
<%

'On Error Resume Next
Dim oCat, strADOXTableName

call GetADOXConnection
message=""

myaction=GetRequestForm("todo")

if myaction="view" then myaction="edit"
' open database connection

Set rs = server.CreateObject ("ADODB.Recordset")

set dbConnection = server.CreateObject ("ADODB.Connection")

dbConnection.ConnectionString = strConnection

dbConnection.Open

Call ReportError
' build SQL query to retrieve data
strSQL = gstrSQL

sWhere = AddWrappers(strKeyField) & "=" & gstrQuote & PrepareKeyColumnValue(strTableName, strKeyField, GetRequestForm("editid")) & gstrQuote

if strKeyField2<>"" then sWhere=sWhere & " and " & AddWrappers(strKeyField2) & "=" & gstrQuote2 & Replace(GetRequestForm("editid2"),"'","''") & gstrQuote2

if strKeyField3<>"" then sWhere=sWhere & " and " & AddWrappers(strKeyField3) & "=" & gstrQuote3 & Replace(GetRequestForm("editid3"),"'","''") & gstrQuote3

strSQL = AddWhere(strSQL, sWhere)
' save changes

if (GetRequestForm("editid")<>"" and GetRequestForm("todo")="edit") then
Set rs = Server.CreateObject("ADODB.Recordset")

if GetDatabaseType()=DATABASE_MySQL or GetDatabaseType()=DATABASE_Oracle then rs.CursorLocation = 3
rs.Open strSQL, dbConnection, 1, 2

If not rs.Eof Then
if IsUpdatable(rs.Fields("CheckNumber")) then

nType = GetFieldType(strTableName, "CheckNumber")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("CheckNumber"),1)="o") then

if GetRequestForm("CheckNumber")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("CheckNumber")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("CheckNumber")

' date edit convert

if GetEditFormat("CheckNumber")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("CheckNumber"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "CheckNumber"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "CheckNumber")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("CheckNumber")=EDIT_FORMATFILE then

if GetRequestForm("typeCheckNumber") = "upload1" or GetRequestForm("typeCheckNumber") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeCheckNumber") = "upload1" Then

rs("CheckNumber") = Null

DeleteFile Server.MapPath(GetUploadFolder("CheckNumber") & GetRequestForm("filenameCheckNumber"))

Else

rs("CheckNumber")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("CheckNumber") & strValue), GetRequestForm("fileCheckNumber")

End If

end if

elseif GetEditFormat("CheckNumber")<>FORMAT_DATABASE_IMAGE and GetEditFormat("CheckNumber")<>FORMAT_DATABASE_FILE then

rs("CheckNumber") = strValue

else

if GetRequestForm("typeCheckNumber") = "file1" or GetRequestForm("typeCheckNumber") = "file2" then

If IsNull(strValue) or GetRequestForm("typeCheckNumber") = "file1" Then

rs("CheckNumber") = Null

Else

rs("CheckNumber").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("Monto")) then

nType = GetFieldType(strTableName, "Monto")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("Monto"),1)="o") then

if GetRequestForm("Monto")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("Monto")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("Monto")

' date edit convert

if GetEditFormat("Monto")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("Monto"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "Monto"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Monto")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("Monto")=EDIT_FORMATFILE then

if GetRequestForm("typeMonto") = "upload1" or GetRequestForm("typeMonto") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeMonto") = "upload1" Then

rs("Monto") = Null

DeleteFile Server.MapPath(GetUploadFolder("Monto") & GetRequestForm("filenameMonto"))

Else

rs("Monto")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("Monto") & strValue), GetRequestForm("fileMonto")

End If

end if

elseif GetEditFormat("Monto")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Monto")<>FORMAT_DATABASE_FILE then

rs("Monto") = strValue

else

if GetRequestForm("typeMonto") = "file1" or GetRequestForm("typeMonto") = "file2" then

If IsNull(strValue) or GetRequestForm("typeMonto") = "file1" Then

rs("Monto") = Null

Else

rs("Monto").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("Comprobante")) then

nType = GetFieldType(strTableName, "Comprobante")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("Comprobante"),1)="o") then

if GetRequestForm("Comprobante")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("Comprobante")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("Comprobante")

' date edit convert

if GetEditFormat("Comprobante")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("Comprobante"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "Comprobante"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Comprobante")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("Comprobante")=EDIT_FORMATFILE then

if GetRequestForm("typeComprobante") = "upload1" or GetRequestForm("typeComprobante") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeComprobante") = "upload1" Then

rs("Comprobante") = Null

DeleteFile Server.MapPath(GetUploadFolder("Comprobante") & GetRequestForm("filenameComprobante"))

Else

rs("Comprobante")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("Comprobante") & strValue), GetRequestForm("fileComprobante")

End If

end if

elseif GetEditFormat("Comprobante")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Comprobante")<>FORMAT_DATABASE_FILE then

rs("Comprobante") = strValue

else

if GetRequestForm("typeComprobante") = "file1" or GetRequestForm("typeComprobante") = "file2" then

If IsNull(strValue) or GetRequestForm("typeComprobante") = "file1" Then

rs("Comprobante") = Null

Else

rs("Comprobante").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("Titular")) then

nType = GetFieldType(strTableName, "Titular")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("Titular"),1)="o") then

if GetRequestForm("Titular")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("Titular")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("Titular")

' date edit convert

if GetEditFormat("Titular")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("Titular"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "Titular"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Titular")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("Titular")=EDIT_FORMATFILE then

if GetRequestForm("typeTitular") = "upload1" or GetRequestForm("typeTitular") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeTitular") = "upload1" Then

rs("Titular") = Null

DeleteFile Server.MapPath(GetUploadFolder("Titular") & GetRequestForm("filenameTitular"))

Else

rs("Titular")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("Titular") & strValue), GetRequestForm("fileTitular")

End If

end if

elseif GetEditFormat("Titular")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Titular")<>FORMAT_DATABASE_FILE then

rs("Titular") = strValue

else

if GetRequestForm("typeTitular") = "file1" or GetRequestForm("typeTitular") = "file2" then

If IsNull(strValue) or GetRequestForm("typeTitular") = "file1" Then

rs("Titular") = Null

Else

rs("Titular").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("Usuario")) then

nType = GetFieldType(strTableName, "Usuario")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("Usuario"),1)="o") then

if GetRequestForm("Usuario")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("Usuario")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("Usuario")

' date edit convert

if GetEditFormat("Usuario")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("Usuario"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "Usuario"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Usuario")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("Usuario")=EDIT_FORMATFILE then

if GetRequestForm("typeUsuario") = "upload1" or GetRequestForm("typeUsuario") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeUsuario") = "upload1" Then

rs("Usuario") = Null

DeleteFile Server.MapPath(GetUploadFolder("Usuario") & GetRequestForm("filenameUsuario"))

Else

rs("Usuario")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("Usuario") & strValue), GetRequestForm("fileUsuario")

End If

end if

elseif GetEditFormat("Usuario")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Usuario")<>FORMAT_DATABASE_FILE then

rs("Usuario") = strValue

else

if GetRequestForm("typeUsuario") = "file1" or GetRequestForm("typeUsuario") = "file2" then

If IsNull(strValue) or GetRequestForm("typeUsuario") = "file1" Then

rs("Usuario") = Null

Else

rs("Usuario").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("NumeroContrato")) then

nType = GetFieldType(strTableName, "NumeroContrato")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("NumeroContrato"),1)="o") then

if GetRequestForm("NumeroContrato")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("NumeroContrato")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("NumeroContrato")

' date edit convert

if GetEditFormat("NumeroContrato")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("NumeroContrato"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "NumeroContrato"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "NumeroContrato")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("NumeroContrato")=EDIT_FORMATFILE then

if GetRequestForm("typeNumeroContrato") = "upload1" or GetRequestForm("typeNumeroContrato") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeNumeroContrato") = "upload1" Then

rs("NumeroContrato") = Null

DeleteFile Server.MapPath(GetUploadFolder("NumeroContrato") & GetRequestForm("filenameNumeroContrato"))

Else

rs("NumeroContrato")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("NumeroContrato") & strValue), GetRequestForm("fileNumeroContrato")

End If

end if

elseif GetEditFormat("NumeroContrato")<>FORMAT_DATABASE_IMAGE and GetEditFormat("NumeroContrato")<>FORMAT_DATABASE_FILE then

'<*

>

'Add this routine to verify the data entered by the user on the aux field

LookUpError = ""

if GetRequestForm("NumeroContratoAux")<>"" then

set rsTemp = Server.CreateObject("ADODB.Recordset")

rsTemp.Open "select * from tbContratos where NumeroContrato='" & GetRequestForm("NumeroContratoAux") & "'" , dbConnection

if rsTemp.eof then

LookUpError="Error"

strValue = ""

Else

strValue = GetData(rsTemp.Fields("NumeroContrato"), FORMAT_NONE )

end if

end if

'</*****
>

rs("NumeroContrato") = strValue

else

if GetRequestForm("typeNumeroContrato") = "file1" or GetRequestForm("typeNumeroContrato") = "file2" then

If IsNull(strValue) or GetRequestForm("typeNumeroContrato") = "file1" Then

rs("NumeroContrato") = Null

Else

rs("NumeroContrato").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("MetodoPago")) then

nType = GetFieldType(strTableName, "MetodoPago")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("MetodoPago"),1)="o") then

if GetRequestForm("MetodoPago")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("MetodoPago")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("MetodoPago")

' date edit convert

if GetEditFormat("MetodoPago")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("MetodoPago"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "MetodoPago"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "MetodoPago")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("MetodoPago")=EDIT_FORMATFILE then

if GetRequestForm("typeMetodoPago") = "upload1" or GetRequestForm("typeMetodoPago") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeMetodoPago") = "upload1" Then

rs("MetodoPago") = Null

DeleteFile Server.MapPath(GetUploadFolder("MetodoPago") & GetRequestForm("filenameMetodoPago"))

Else

rs("MetodoPago")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("MetodoPago") & strValue), GetRequestForm("fileMetodoPago")

End If

end if

elseif GetEditFormat("MetodoPago")<>FORMAT_DATABASE_IMAGE and GetEditFormat("MetodoPago")<>FORMAT_DATABASE_FILE then

rs("MetodoPago") = strValue

else

if GetRequestForm("typeMetodoPago") = "file1" or GetRequestForm("typeMetodoPago") = "file2" then

If IsNull(strValue) or GetRequestForm("typeMetodoPago") = "file1" Then

rs("MetodoPago") = Null

Else

rs("MetodoPago").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("TipoPago")) then

nType = GetFieldType(strTableName, "TipoPago")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("TipoPago"),1)="o") then

if GetRequestForm("TipoPago")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("TipoPago")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("TipoPago")

' date edit convert

if GetEditFormat("TipoPago")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("TipoPago"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "TipoPago"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "TipoPago")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("TipoPago")=EDIT_FORMATFILE then

if GetRequestForm("typeTipoPago") = "upload1" or GetRequestForm("typeTipoPago") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeTipoPago") = "upload1" Then

rs("TipoPago") = Null

DeleteFile Server.MapPath(GetUploadFolder("TipoPago") & GetRequestForm("filenameTipoPago"))

Else

rs("TipoPago")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("TipoPago") & strValue), GetRequestForm("fileTipoPago")

End If

end if

elseif GetEditFormat("TipoPago")<>FORMAT_DATABASE_IMAGE and GetEditFormat("TipoPago")<>FORMAT_DATABASE_FILE then

rs("TipoPago") = strValue

else

if GetRequestForm("typeTipoPago") = "file1" or GetRequestForm("typeTipoPago") = "file2" then

If IsNull(strValue) or GetRequestForm("typeTipoPago") = "file1" Then

rs("TipoPago") = Null

Else

rs("TipoPago").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("InstitucionPago")) then

nType = GetFieldType(strTableName, "InstitucionPago")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("InstitucionPago"),1)="o") then

if GetRequestForm("InstitucionPago")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("InstitucionPago")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("InstitucionPago")

' date edit convert

if GetEditFormat("InstitucionPago")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("InstitucionPago"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "InstitucionPago"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "InstitucionPago")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("InstitucionPago")=EDIT_FORMATFILE then

if GetRequestForm("typeInstitucionPago") = "upload1" or GetRequestForm("typeInstitucionPago") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeInstitucionPago") = "upload1" Then

rs("InstitucionPago") = Null

DeleteFile Server.MapPath(GetUploadFolder("InstitucionPago") & GetRequestForm("filenameInstitucionPago"))

Else

rs("InstitucionPago")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("InstitucionPago") & strValue), GetRequestForm("fileInstitucionPago")

End If

end if

elseif GetEditFormat("InstitucionPago")<>FORMAT_DATABASE_IMAGE and GetEditFormat("InstitucionPago")<>FORMAT_DATABASE_FILE then

rs("InstitucionPago") = strValue

else

if GetRequestForm("typeInstitucionPago") = "file1" or GetRequestForm("typeInstitucionPago") = "file2" then

If IsNull(strValue) or GetRequestForm("typeInstitucionPago") = "file1" Then

rs("InstitucionPago") = Null

Else

rs("InstitucionPago").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("Numero")) then

nType = GetFieldType(strTableName, "Numero")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("Numero"),1)="o") then

if GetRequestForm("Numero")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("Numero")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("Numero")

' date edit convert

if GetEditFormat("Numero")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("Numero"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "Numero"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Numero")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("Numero")=EDIT_FORMATFILE then

if GetRequestForm("typeNumero") = "upload1" or GetRequestForm("typeNumero") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeNumero") = "upload1" Then

rs("Numero") = Null

DeleteFile Server.MapPath(GetUploadFolder("Numero") & GetRequestForm("filenameNumero"))

Else

rs("Numero")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("Numero") & strValue), GetRequestForm("fileNumero")

End If

end if

elseif GetEditFormat("Numero")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Numero")<>FORMAT_DATABASE_FILE then

rs("Numero") = strValue

else

if GetRequestForm("typeNumero") = "file1" or GetRequestForm("typeNumero") = "file2" then

If IsNull(strValue) or GetRequestForm("typeNumero") = "file1" Then

rs("Numero") = Null

Else

rs("Numero").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("Status")) then

nType = GetFieldType(strTableName, "Status")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("Status"),1)="o") then

if GetRequestForm("Status")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("Status")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("Status")

' date edit convert

if GetEditFormat("Status")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("Status"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "Status"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Status")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("Status")=EDIT_FORMATFILE then

if GetRequestForm("typeStatus") = "upload1" or GetRequestForm("typeStatus") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeStatus") = "upload1" Then

rs("Status") = Null

DeleteFile Server.MapPath(GetUploadFolder("Status") & GetRequestForm("filenameStatus"))

Else

rs("Status")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("Status") & strValue), GetRequestForm("fileStatus")

End If

end if

elseif GetEditFormat("Status")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Status")<>FORMAT_DATABASE_FILE then

rs("Status") = strValue

else

if GetRequestForm("typeStatus") = "file1" or GetRequestForm("typeStatus") = "file2" then

If IsNull(strValue) or GetRequestForm("typeStatus") = "file1" Then

rs("Status") = Null

Else

rs("Status").AppendChunk strValue

End If

end if

end if

end if
if IsUpdatable(rs.Fields("Notas")) then

nType = GetFieldType(strTableName, "Notas")
' boolean

if nType=11 or (nType=131 and Left(GetRequestForm("Notas"),1)="o") then

if GetRequestForm("Notas")="on" then

strValue="1"

else

strValue="0"

end if

else ' not boolean

if GetRequestForm("Notas")="" and ( nType=72 or nType=133 or nType=134 or nType=135 ) then

strValue = NULL

else

strValue=GetRequestForm("Notas")

' date edit convert

if GetEditFormat("Notas")=EDIT_FORMAT_DATE or IsDateFieldType(nType) then

strValue= FormatDbDate(strValue, DateEditType("Notas"))

end if

if IfNeedQuotes(GetFieldType(strTableName, "Notas"))<>"True" or IsDateFieldType(GetFieldType(strTableName, "Notas")) then

if strValue="" then

strValue=Null

end if

end if

if IsFloat(nType) and strValue<>"" then

strValue = Replace(strValue, ",", ".")

end if

end if

end if
if GetEditFormat("Notas")=EDIT_FORMATFILE then

if GetRequestForm("typeNotas") = "upload1" or GetRequestForm("typeNotas") = "upload2" then

If IsNull(strValue) or GetRequestForm("typeNotas") = "upload1" Then

rs("Notas") = Null

DeleteFile Server.MapPath(GetUploadFolder("Notas") & GetRequestForm("filenameNotas"))

Else

rs("Notas")= strValue

if strValue<>"" then


WriteToFile Server.MapPath(GetUploadFolder("Notas") & strValue), GetRequestForm("fileNotas")

End If

end if

elseif GetEditFormat("Notas")<>FORMAT_DATABASE_IMAGE and GetEditFormat("Notas")<>FORMAT_DATABASE_FILE then

rs("Notas") = strValue

else

if GetRequestForm("typeNotas") = "file1" or GetRequestForm("typeNotas") = "file2" then

If IsNull(strValue) or GetRequestForm("typeNotas") = "file1" Then

rs("Notas") = Null

Else

rs("Notas").AppendChunk strValue

End If

end if

end if

end if
'<*


>

'Add this lines to update only if the aux fiels are empty or with a valid value

If LookUpError = "" then

'</****>
rs.Update

rs.Close
'<


>

'Add this lines to update only if the aux fiels are empty or with a valid value

End If

'</****>
end if
'<


>

'Add this lines to update only if the aux fiels are empty or with a valid value

If LookUpError = "" then

'</****>
Call ReportError

message="<div class=message><<< " & "Record updated" & " >>></div>"
'<


>

'Add this lines to Show the error dialog box if aux fields are incorrect

Else

Response.Write "<script language=""JavaScript"">"

Response.Write "var WrongFileValue = """";"

Response.Write "WrongFileValue += ""NumeroContrato\n"";"

Response.Write "alert( ""ERROR EN INGRESO: \r\n\r\n""+ WrongFileValue + ""\r\n\r\n"" );"

Response.Write "</script>"

message="<div class=message><<< " & "ERROR EN INGRESO" & " >>></div>"

End If

'</****>
end if
sMode = "Edit"
Response.Write "<h1>Pagos Recibidos Detalle, " & "Edit record" & " [" & strKeyField & ": " & GetRequestForm("editid")

if strKeyField2<>"" then Response.Write ", " & strKeyField2 & ": " & GetRequestForm("editid2") end if

if strKeyField3<>"" then Response.Write ", " & strKeyField3 & ": " & GetRequestForm("editid3") end if

Response.Write "]</h1>"
response.write message

response.write "<div align=left><hr width=300 noshade size=1></div>"
'<


>

'Add this lines to proced only if the aux fiels are empty or with a valid value

If LookUpError = "" then

'</****>
LogInfo(strSQL)

rs.open strSQL, dbConnection

Call ReportError
'<


**>

'Add this lines to proced only if the aux fiels are empty or with a valid value

End If

'</***>
' "back to list" link

if Session(strTableName & "_ListURL")="" or right(Session(strTableName & "_ListURL"),1)="?" then

sHref = "tbDepositosDetalle_list.asp?action=backtolist"

else

sHref = Session(strTableName & "_ListURL")

end if

Response.write "Â Â Â <a href=""" & sHref & """>" & "Back to list" & "</a>

"
Response.Write "<table cellpadding=2>"

%>
<form name="editform" method="POST" enctype="multipart/form-data" action=tbDepositosDetalle_edit.asp onSubmit=" return validate();"">

<input type=hidden name=editid value="<%=HTMLEncode(GetRequestForm("editid"))%>">

<input type=hidden name=editid2 value="<%=HTMLEncode(GetRequestForm("editid2"))%>">

<input type=hidden name=editid3 value="<%=HTMLEncode(GetRequestForm("editid3"))%>">

<input type=hidden id=masterkey name=masterkey value="<%=GetRequestForm("masterkey")%>">
<%

strPK = AddWrappers(strKeyField)

if strKeyField2<>"" then strPK = strPK & "," & AddWrappers(strKeyField2)

if strKeyField3<>"" then strPK = strPK & "," & AddWrappers(strKeyField3)
sFieldName = "NumeroDeposito"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "NumeroDepositoDetalle"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "CheckNumber"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "Monto"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "Comprobante"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "Titular"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "Usuario"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "NumeroContrato"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
'<

>

'Add this line to include a new aux field

Response.Write "<input type=text name=NumeroContratoAux>"

'</
>
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "MetodoPago"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "TipoPago"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "InstitucionPago"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "Numero"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "Status"
if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then

Response.Write vbCRLF & "<tr><td class=shade>"

Response.Write Label(sFieldName) & " "

Response.Write "</td><td>"

end if
bUpdatable = IsUpdatable(rs.Fields(sFieldName))
if GetEditFormat(sFieldName) <> EDIT_FORMAT_HIDDEN then
if Format(rs.Fields(sFieldName).Name) <> FORMAT_HTML then

strEncoded = HTMLEncode(strValue)

else

strEncoded = strValue

end if
if bUpdatable or IsBinaryField(rs.Fields(sFieldName)) or Format(rs.Fields(sFieldName).Name)=FORMAT_DATABASE_FILE then

sFormat = GetEditFormat(sFieldName)

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, sFormat, sMode)

else

strEncoded = GetData(rs.Fields(sFieldName), Format(rs.Fields(sFieldName).Name))

Response.Write Replace(strEncoded, vbcrlf, "
")

end if
' add icons if required

Response.Write GetLegendIcon(sFieldName, nType, i)
Response.Write "</td></tr>"
else

Response.Write BuildEditControl(rs.Fields(sFieldName), strValue, GetEditFormat(sFieldName), sMode)

end if
sFieldName = "Notas"
if rs.EOF and rs.BOF then

strValue=""<b

500340 11/16/2005

Forgot to say it is _Edit.asp page. I anybody needs _Add.asp, that is a litle bit diferent, I will post it here.'
Thanks