If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Type Mismatch

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-04, 01:35
notaprogrammer notaprogrammer is offline
Registered User
 
Join Date: Dec 2004
Posts: 4
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 01:36. Reason: dreaded typo
Reply With Quote
  #2 (permalink)  
Old 12-02-04, 22:54
notaprogrammer notaprogrammer is offline
Registered User
 
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?
Reply With Quote
  #3 (permalink)  
Old 12-03-04, 01:44
notaprogrammer notaprogrammer is offline
Registered User
 
Join Date: Dec 2004
Posts: 4
Update

UPDATE: I have resolved my issue
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On