I keep getting this error:
Procedure 'cnpcpiFarmFormAssignField' expects parameter '@chUserId', which was not supplied.
if request.Form("hidAction") = "" and request.QueryString("sid") = "" then
sFormAction = "New"
else
Set cmd = Server.CreateObject("ADODB.Command")
with cmd
.ActiveConnection = DataConn
.CommandType = adCmdStoredProc
end with
'On Error Resume Next
if request.Form("hidAction") = "New" then
'cint(iFormId) = request.QueryString("iFormId")
'Insert Record
With cmd
.CommandText = "cnpcpiFarmFormAssignField"
Set prmiFormId = .CreateParameter("@iFormId",adInteger,adParamInput,,request.Form("hidiFormId"))
Set prmiFieldId = .CreateParameter("@iFieldId",adInteger,adParamInput,,request.Form("lstFormField"))
Set prmiSequenceId = .CreateParameter("@iSequence",adInteger,adParamInput,,request.Form("lstSequence"))
Set prmvchLabel = .CreateParameter("@vchLabel", adVarChar, adParamInput, 50,trim(request.Form("txtLabel")))
Set prmtiRequired = .CreateParameter("@tiRequiredField",adInteger,adParamInput,,cint(request.Form("lstRequired")))
'set prmtiAlphaNumericCheck = .CreateParameter("@tiAlphaNumericCheck",adInteger,adParamInput,,iNumericAlphaCheck)
if request.Form("txtMinLength") = "" then
set prmiMinLength = .CreateParameter("@iMinLength",adInteger,adParamInput,,null)
else
set prmiMinLength = .CreateParameter("@iMinLength",adInteger,adParamInput,,cint(request.Form("txtMinLength")))
end if
if request.Form("txtMaxLength") = "" then
set prmiMaxLength = .CreateParameter("@iMaxLength",adInteger,adParamInput,,null)
else
set prmiMaxLength = .CreateParameter("@iMaxLength",adInteger,adParamInput,,cint(request.Form("txtMaxLength")))
end if
set prmiSize = .CreateParameter("@iSize",adInteger,adParamInput,,cint(request.Form("txtSize"))) 'M001a
Set prmUserId = .CreateParameter("@chUserId",adChar,adParamInput,10,getOnyxUserId)
Set prmiFormFieldId = .CreateParameter("@iFormFieldId",adInteger,adParamOutput)
Set prmReturnValue = .CreateParameter("@iReturnCode",adInteger,adParamOutput)
.Parameters.Append prmiFormId
.Parameters.Append prmiFieldId
.Parameters.Append prmiSequenceId
.Parameters.Append prmvchLabel
.Parameters.Append prmtiRequired
'.Parameters.Append prmtiAlphaNumericCheck
.Parameters.Append prmiMinLength
.Parameters.Append prmiMaxLength
.Parameters.Append prmiSize 'M001a
.Parameters.Append prmUserId
.Parameters.Append prmiFormFieldId
.Parameters.Append prmReturnValue
.Execute
iFormFieldId = .Parameters("@iFormFieldId") 'ID After Insert
sSprocReturnVal = .Parameters("@iReturnCode")
End With
%>
<script language="vbscript">
window.opener.location = "addFormCreator.asp?sid=<%=request.QueryString("iFormId")%>"
</script>
<%
end if