invalid property assignment

Results 1 to 2 of 2

Thread: invalid property assignment

  1. #1
    Join Date
    Dec 1969

    Default invalid property assignment

    I borrowed the idea for this from one of the FAQ&#039;s:<BR><BR>Function formatForm()<BR>&nbsp;&nbsp;Set formFields = Server.CreateObject("Scripting.Dictionary")<BR>&nb sp;&nbsp;formFields.CompareMode = 1<BR>&nbsp;&nbsp;For each item in Request.Form<BR>&nbsp;&nbsp;&nbsp;&nbsp;formFields .Add CStr(item), Replace(Trim(Request.Form(item)),"&#039;","&#039;& #039;") <BR>&nbsp;&nbsp;Next<BR>&nbsp;&nbsp;Set formatForm = formFields<BR>End Function<BR><BR><BR>myForm = formatForm()<BR><BR><BR>However, I get this error: Wrong number of arguments or invalid property assignment: &#039;myForm&#039;<BR><BR>I pulled the code out of the function and tried to assign another variable to the dictionary object and I got an invalid property assignment error.<BR><BR>Does anyone see what I&#039;m doing wrong?

  2. #2
    Join Date
    Dec 1969

    Default Tch tch...

    *WHAT* is that function returning???<BR><BR>Hint: Look at this line:<BR><BR>Set formatForm = formFields<BR><BR>What&#039;s the first word on that line?<BR><BR>Hmmm???<BR><BR>So maybe you need to do<BR><BR>Set myForm = formatForm( )<BR><BR>???<BR><BR>(It&#039;s an object reference, and VBS requires SET with object references.)<BR>

Posting Permissions

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