Type mismatch fejl
HejsaJeg har nedenstående kode som giver mig en " Type mismatch: 'SAMLET' " fejl ved linje 105, nogle ideér?
<!--#include file="connection.inc"-->
<%
strSQL = "select sum(Indskud) as sum_ind, sum(Debit) as sum_deb, sum(Kredit) as sum_kre from Regnskab Where Aar < '2010'"
Set rs4 = Conn.Execute(strSQL)
SAMLET_2007 = Rs4("sum_ind") + Rs4("sum_deb") - Rs4("sum_kre")
%>
<table align="center" style="font-size:11px;font-weight:bold;text-align:left;">
<tr>
<td width="120px">Overført fra <u>2009</u>:</td>
<td width="60px"><u><%=SAMLET_2007%></u></td>
</tr>
</table>
<br>
<br>
<table border="0" align="center" style="font-size:11px;font-weight:bold;text-align:right;" width="1020px">
<tr>
<td width="60px"></td>
<td width="80px">Januar</td>
<td width="80px">Februar</td>
<td width="80px">Marts</td>
<td width="80px">April</td>
<td width="80px">Maj</td>
<td width="80px">Juni</td>
<td width="80px">Juli</td>
<td width="80px">August</td>
<td width="80px">September</td>
<td width="80px">Oktober</td>
<td width="80px">November</td>
<td width="80px">December</td>
</tr>
<tr>
<td colspan="13"><hr></td>
</tr>
<tr>
<td width="35px">
<table width="100%" style="font-weight:bold;font-size:11px;text-align:left;" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="35px" align="left">indskud</td>
</tr>
<tr>
<td width="35px" align="left">indtægt</td>
</tr>
<tr>
<td width="35px" align="left">udgift</td>
</tr>
<tr><td height="5px"></td></tr>
<tr>
<td width="35px" align="left"><b>Samlet</b></td>
</tr>
<tr><td height="15px"></td></tr>
<tr>
<td width="35px" align="left"><b>Saldo</b></td>
</tr>
</table>
</td>
<%
AAR = 2010
for b = 1 to 12
strSQL = "select sum(Indskud) as sum_ind, sum(Debit) as sum_deb, sum(Kredit) as sum_kre from Regnskab Where Aar = '" & AAR & "'" & "AND Maaned = "& b
Set rs = Conn.Execute(strSQL)
if not rs.eof then
do
SUM_IN = Rs("sum_ind")
SUM_DE = Rs("sum_deb")
SUM_KR = Rs("sum_kre")
SAMLET = Rs("sum_ind") + Rs("sum_deb") - Rs("sum_kre")
if SUM_IN <> "" Then
SUM_IN = formatnumber(SUM_IN,2)
else
SUM_IN = ""
end if
if SUM_DE <> "" Then
SUM_DE = formatnumber(SUM_DE,2)
else
SUM_DE = ""
end if
if SUM_KR <> "" Then
SUM_KR = "-" & formatnumber(SUM_KR,2)
else
SUM_KR = ""
end if
if SAMLET <> "" Then
SAMLET = formatnumber(SAMLET,2)
else
SAMLET = ""
end if
If b = 1 Then
SALDO = SAMLET_2007 + SAMLET
SALDO_JAN = SALDO
Elseif b = 2 Then
SALDO = SALDO_JAN + SAMLET
SALDO_FEB = SALDO
Elseif b = 3 Then
SALDO = SALDO_FEB + SAMLET
SALDO_MAR = SALDO
Elseif b = 4 Then
SALDO = SALDO_MAR + SAMLET <----- linje 105 ------
SALDO_APR = SALDO
Elseif b = 5 Then
SALDO = SALDO_APR + SAMLET
SALDO_MAY = SALDO
Elseif b = 6 Then
SALDO = SALDO_MAY + SAMLET
SALDO_JUN = SALDO
Elseif b = 7 Then
SALDO = SALDO_JUN + SAMLET
SALDO_JUL = SALDO
Elseif b = 8 Then
SALDO = SALDO_JUL + SAMLET
SALDO_AUG = SALDO
Elseif b = 9 Then
SALDO = SALDO_AUG + SAMLET
SALDO_SEP = SALDO
Elseif b = 10 Then
SALDO = SALDO_SEP + SAMLET
SALDO_OKT = SALDO
Elseif b = 11 Then
SALDO = SALDO_OKT + SAMLET
SALDO_NOV = SALDO
Else
SALDO = SALDO_NOV + SAMLET
SALDO_DEC = SALDO
End if
if SAMLET_2007 <> "" Then
SAMLET_2007 = formatnumber(SAMLET_2007,2)
else
SAMLET_2007 = ""
end if
if SALDO <> "" Then
SALDO = formatnumber(SALDO,2)
else
SALDO = ""
end if
%>
<td style="font-weight:normal;text-align:center;" width="75px">
<table width="100%" style="font-size:11px;" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align:right;" width="70px"><%=SUM_IN%></td>
</tr>
<tr>
<td style="text-align:right;" width="70px"><%=SUM_DE%></td>
</tr>
<tr>
<td style="text-align:right;" width="70px"><%=SUM_KR%></td>
</tr>
<tr><td height="5px"></td></tr>
<tr>
<td style="text-align:right;" width="75px"><span><b><%=SAMLET%></b></span></td>
</tr>
<tr><td height="15px"></td></tr>
<tr>
<td style="text-align:right;" width="75px"><span><b><u><%=SALDO%></u></b></span></td>
</tr>
</table>
</td>
<%
rs.movenext
loop while not rs.eof
set rs= nothing
end if
next
%>
</tr>
</table>
<br><br>
<%
Conn.Close
Set Conn = Nothing
%>