I'm trying to use the transfertext method to create a text file with the information in the Recordset (rst). I'm getting the error "An expression you entered is the wrong data type for one of the arguments," The error is in the last line; I assume the problem is the rst variable. I did a little research and the spec for transfertext indicates Table or query for "Tablename" so perhaps I can't use this method, but it sure would be nice.

Does anyone know if this can work?
(Access 2002)


Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String

strSQL = " SELECT dbo_CREDITS_DETAIL.Full_Item, dbo_CREDITS_DETAIL.Price, dbo_CREDITS_DETAIL.QTY" & _
" FROM dbo_CREDITS_DETAIL" & _
" WHERE (((dbo_CREDITS_DETAIL.TTNUM) = " & Me!TTNUM & "))"

Set db = CurrentDb
Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)

DoCmd.TransferText acExportDelim, , rst, "H:\Text_Files\Test3.txt"