I have some code as follows:
Set dbs = CurrentDb
strSQL = "SELECT tbl_Request.RequestID, tbl_Request.PriorityMIS, " & _
"tbl_MIS.Name, tbl_Request.DateDelivery, tbl_Request.Time " & _
"FROM tbl_MIS INNER JOIN tbl_Request ON tbl_MIS.MISID = tbl_Request.MIS " & _
"WHERE (((tbl_Request.PriorityMIS) > 0) And ((tbl_MIS.Name) = " & _
"CurrentUser()) And ((fncGetMaxStatus([RequestID])) < 50)) " & _
"ORDER BY fncIsactive([requestid]), fncCreatedate([requestid]);"
'strSQL = "SELECT * FROM tbl_Request"
Set rst = dbs.OpenRecordset(strSQL)
rst.Close
Set dbs = Nothing
When I set rst = dbs.openrecordset(strSQL) it causes Access to crash.
If I use that strSQL in a Query and open the recordset as the query it crashes. The query opens without a problem.
All the functions are referenced in other queries without a problem.
Any ideas
If at first you don't succeed, try for the answer.
Set dbs = CurrentDb
strSQL = "SELECT tbl_Request.RequestID, tbl_Request.PriorityMIS, " & _
"tbl_MIS.Name, tbl_Request.DateDelivery, tbl_Request.Time " & _
"FROM tbl_MIS INNER JOIN tbl_Request ON tbl_MIS.MISID = tbl_Request.MIS " & _
"WHERE (((tbl_Request.PriorityMIS) > 0) And ((tbl_MIS.Name) = " & _
"CurrentUser()) And ((fncGetMaxStatus([RequestID])) < 50)) " & _
"ORDER BY fncIsactive([requestid]), fncCreatedate([requestid]);"
'strSQL = "SELECT * FROM tbl_Request"
Set rst = dbs.OpenRecordset(strSQL)
rst.Close
Set dbs = Nothing
When I set rst = dbs.openrecordset(strSQL) it causes Access to crash.
If I use that strSQL in a Query and open the recordset as the query it crashes. The query opens without a problem.
All the functions are referenced in other queries without a problem.
Any ideas
If at first you don't succeed, try for the answer.