Results 1 to 3 of 3

Thread: Type Mismatch

  1. #1
    Join Date
    Dec 2004
    Posts
    4

    Unanswered: Type Mismatch

    I've read through the forum and still haven't found what is going on with my code I received a Type Mismatch error...

    Error Type:
    Microsoft VBScript runtime (0x800A000D)
    Type mismatch
    /ChartEdit.asp, line 72

    The line causing the error is if FrequencyID <> NFrequencyID then

    Code:
    <%
    	FreqQuery = "SELECT* FROM LKpFrequency where FrequencyID=" & FrequencyID 
    	Call Selected.Open(FreqQuery, DBConn)
    	if Not Selected.eof then
    		FrequencyID = Selected("FrequencyID")
    		FrequencyDesc = Selected("FrequencyDesc")
    		Response.write("<label>FrequencyID:       <select name=FrequencyID>")
    		Response.Write ("<option value=" & FrequencyID & ">" & FrequencyDesc &"</option>")		
    	end if
    	Selected.CLOSE
    	
    	AllFreqQuery = "Select * From LKpFrequency"
    	Call NSelected.Open(AllFreqQuery, DBConn)
    	if Not NSelected.BOF then
    		Do While NOT NSelected.EOF
    			'Get the Frequency values from the database
    			NFrequencyID = NSelected("FrequencyID")
    			FrequencyDesc = NSelected("FrequencyDesc")
    			if FrequencyID <> NFrequencyID then
    				Response.Write ("<option value=" & NFrequencyID & ">" & "'FrequencyDesc'" &"</option>")
    			end if
    			NSelected.MoveNext
    		Loop
    	end if
    	NSelected.CLOSE
    		Response.write("</select><BR>")
    %>
    Last edited by notaprogrammer; 12-02-04 at 02:36. Reason: dreaded typo

  2. #2
    Join Date
    Dec 2004
    Posts
    4

    duplicate items in drop down list

    If I comment out the If Statement causing my type mismatch error and the end if naturally my code will run without error then only issue is that the item will display in the drop down list twice. Once because I populated the selected value and second because I'm pulling all the options from the look up table. Any suggestions on a better way to handle this?

  3. #3
    Join Date
    Dec 2004
    Posts
    4

    Update

    UPDATE: I have resolved my issue

Posting Permissions

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