ATTN: dsetzer

Results 1 to 2 of 2

Thread: ATTN: dsetzer

  1. #1
    Join Date
    Dec 1969

    Default ATTN: dsetzer

    Got a question about the help you provided yesterday about passing the status to a function.. Ok here is my deal, I cant get the value to pass to the function.. I copied the function just as you put it, but I cant even get the value to the function.. I created a value for the strVStat item, but it still doesnt pass to the function still.. How do I tell the function what strVStat is? Here is my function: (I changed it around a little)<BR><BR>&#060;%<BR>Function AdminListRO(sabDB, strVStat)<BR><BR> Dim ListRS<BR> Dim strSQL<BR> <BR><BR>If strVStat = "Active" OR _<BR> strVStat = "Finished" OR _<BR> strVStat = "Incomplete" OR _<BR> strVStat = "Archive" Then<BR> <BR> <BR> strSQL = "SELECT * FROM main "<BR> strSQL = strSQL & "WHERE V_Stat = &#039;" & strVStat & "&#039; "<BR> strSQL = strSQL & "ORDER BY RO_Num"<BR><BR>Else<BR> Exit function<BR>End if<BR><BR> Set ListRS = Server.CreateObject("ADODB.Recordset")<BR> ListRS.Open strSQL, sabDB, adOpenKeyset, adOpenStatic<BR><BR> Set AdminListRO = ListRS<BR>End Function<BR>%&#062;<BR><BR>Now I am trying to call this function using a button, here is what I changed my button form to:<BR><BR>&#060;form action="data.asp"&#062;<BR>&#060;input type="hidden" name="action" value="adminlist"&#062;<BR>&#060;input type="hidden" name="strVStat" value="Active"&#062;<BR>&#060;input type="submit" value="Edit Records"&#062;<BR>&#060;/form&#062;<BR><BR>Now it passes the value for strVStat as Active (this is what I want default to be), but the Function still doesnt list.. What am I doing wrong with this? I have a pulldown menu that I want to use to give strVStat a value so that the function can pull the correct info based on status.. I want it so that when a different value in the pulldown is selected then the screen will display the correct info.. I have all of this setup, but I cant seem to get the function to work the way you told me to.. Anymore suggestions? What am I doing wrong?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Put some debugging code in.

    &#060;%<BR>Function AdminListRO(sabDB, strVStat)<BR>Response.Write "AdminList -- START::&#060;br /&#062;" & vbCRLF<BR>Response.Write "sabDB::" & sabDB & "&#060;br /&#062;" & vbCRLF<BR>Response.Write "strVStat::" & strVStat & "&#060;br /&#062;" & vbCRLF<BR>Dim ListRS<BR>Dim strSQL<BR><BR><BR>If strVStat = "Active" OR _<BR>strVStat = "Finished" OR _<BR>strVStat = "Incomplete" OR _<BR>strVStat = "Archive" Then<BR><BR><BR>strSQL = "SELECT * FROM main "<BR>strSQL = strSQL & "WHERE V_Stat = &#039;" & strVStat & "&#039; "<BR>strSQL = strSQL & "ORDER BY RO_Num"<BR>Response.Write "strSQL::" & strSQL & "&#060;br /&#062;" & vbCRLF<BR><BR>Else<BR>Response.Write "AdminList -- END INVALID VSTAT::&#060;br /&#062;" & vbCRLF<BR>Exit function<BR>End if<BR><BR>Set ListRS = Server.CreateObject("ADODB.Recordset")<BR>ListRS.O pen strSQL, sabDB, adOpenKeyset, adOpenStatic<BR><BR>Set AdminListRO = ListRS<BR>Response.Write "AdminList -- END RS RETURNED::&#060;br /&#062;" & vbCRLF<BR>End Function<BR>%&#062;<BR><BR>-Doug

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts