Here is a copy of the agent that I have been working on. The form that I have sends two values to the agent using webquerysave, “get”, querystringdecoded and a saveoptions field.
I’ve been told I should: Let the document the user saves, continue saving, and THEN change the “Form” field and do a Print statement to redirect to that document.
How do I do this? Do I have to place code in the view as well? And what should it say? Thank you all in advance!
'—Code for sql query after parsing values and making odbc connection—
'retrieve parsed variables from user
torig2 = AgentArgs ("t_orig")
tdest2 = AgentArgs ("t_dest")
'Send query to SQL database
qry.SQL = "SELECT DISTINCT torig, tdest, tldest, tlorig, transoption, tlduration FROM Trans WHERE opt_num ='1' AND torig='" + torig2 + "' AND tdest='" + tdest2 + "'"
result.Execute
If Not result.Execute Then
result.GetErrorMessage
Print "No chance"
End If
'Retrieve variables from SQL Query
Do
result.NextRow
tldest = result.GetValue("TLDEST", tldest)
tlorig = result.GetValue("TLORIG", tlorig)
transoption = result.GetValue("TRANSOPTION",transoption)
tlduration = result.GetValue("TLDURATION", tlduration)
Print"<table cellpadding = 10 cellspacing = 3>"
Print"<tr>"
Print"<td>"
Print tlorig " to "
Print"<td>"
Print tldest
Print"<td>"
Print "Using " + transoption
Print"<td>"
Print tlduration + " Mins"
Print "<tr>"
Print"</table>"
Loop Until result.IsEndOfData
(I was told the final print statement would look like this:
'Print "[/" & db.ReplicaID & "/0/" & doc.UniversalID & "]"
result.Close(DB_CLOSE)
con.Disconnect
'-close connection
End Sub