PDA

View Full Version : Recordset help



Phrump
11-24-2011, 08:43 AM
Hi,

I have this lovely piece of code



Private Sub PropertyRef_AfterUpdate()
Dim rstTemp As Recordset
Dim qrydefTemp As QueryDef
Dim strSQL As String
Dim strRepairAgent As String

strSQL = "SELECT PRP_ADDRESS_1, PRP_ADDRESS_2, PRP_POST_CODE FROM TASKDBA_WM_PROPERTY WHERE PRP_REFERENCE=" & Chr(34) & [Forms]![frmemptyhomes]![PropertyRef] & Chr(34) & ";"
Set rstTemp = CurrentDb.OpenRecordset(strSQL)

if i run it for the output, the SQL works in a query, but when i run it into the recordset i get an error Runtime error "13", Type Mismatch.


Any help would be appreciated... im starting to lose my mind.


Thanks