Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type mismatch on recordset

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I am running into a strange error with my database. Here is my code:

Dim Invoice_Table As DAO.Recordset
Set db = CurrentDb()

For i = 1 To tempnum
Set Invoice_Table = db.OpenRecordset(mysql_statement)
For j = 1 To tempnum2
invoicedamount = invoicedamount + Invoice_Table.fields("ActualAmount")
Next j

If (invoicedamount < quotedamount(i)) Then
MsgBox (error_msg)
End If
Invoice_Table.Close
Next i
Set Invoice_Table = Nothing
[/color]


The error message I am getting is: &quot;Complie error: Type mismatch&quot; and when I click &quot;ok&quot; on the error message box, &quot;db.OpenRecordset&quot; is highlighted, as if the error is only occuring in this statement. I don't think it's because of my sql statement because I think it would have highlighted the particular part of the sql statement that was having issues (I have the sql statement spelled out in my code, but didn't put that on here). I have used this recordset syntax before and haven't had any issues. Can anyone help me figure out what exactly is going on? Thanks!
 
Oh nevermind, I'm such a dork, I figured out what was going on. Stupid quotation marks. heh. thanks anyway though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top