One little problem I have just run into.
Now that I have the IF statement working so that it just displays the 'other' engineers data as text and their own as a text field. When you click submit it overwrites nothing to the db (but only for the text on its own)
Any ideas.
<%
If (CStr(Request("MM_update")) = "form2") Then
If (Not MM_abortEdit) Then
' execute the update
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_tynans_mysql_STRING
MM_editCmd.CommandText = "UPDATE tynansdb.tynan_jobs SET engineers_notes = ?, materials = ?, time_on_site = ?, time_off_site = ?, total_on_site = ?, travel_time = ?, total_hours = ?, secondary_engineers_notes = ? WHERE ID = ?"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 16777215, Request.Form("engineers_notes")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 16777215, Request.Form("materials")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 500, Request.Form("time_on_site")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 500, Request.Form("time_off_site")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 5, 1, -1, MM_IIF(Request.Form("total_on_site"), Request.Form("total_on_site"), null)) ' adDouble
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 5, 1, -1, MM_IIF(Request.Form("travel_time"), Request.Form("travel_time"), null)) ' adDouble
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 5, 1, -1, MM_IIF(Request.Form("total_hours"), Request.Form("total_hours"), null)) ' adDouble
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param8", 202, 1, 16777215, Request.Form("secondary_engineers_notes")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param9", 5, 1, -1, MM_IIF(Request.Form("MM_recordId"), Request.Form("MM_recordId"), null)) ' adDouble
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "my_jobs.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
Must be because their is no Request.Form("engineers_notes") or Request.Form("secondary_engineers_notes") if it is only displayed as text but Im not sure of how to work around this.
Best Regards
James