I have created the temp table from a query, the records in the table are what I want, but when I go to the Set db = CurrentDb I get a data Run Time error 13 Type Mismatch error.
I have checked the names of the fields and their type on the query against the temp table and they are fine.
Dim strQryFile As String
Dim strQryFileSql As String
Dim db As Database
Dim RecCounter As Integer
strQryFile = "DdTransTemp"
strQryFileSql = "SELECT * INTO DdTransTemp FROM DdSelectTransInRangeQry; "
DoCmd.SetWarnings False
DoCmd.RunSQL strQryFileSql
DoCmd.SetWarnings True
Dim rs As DAO.Recordset
Dim lUserID As Long
DBEngine.SetOption dbMaxLocksPerFile, 1000000
On Error GoTo ErrTrap
TaskCompletedFld = 0
Me.QryFile = strQryFile
lUserID = Me.UserIdFld.Value
Set db = CurrentDb
The last line is the one that creates the error. If I try to view it's contents (CurrentDb) in the immediate window I get the same thing
Anyone have any ideas about it.
I have checked the names of the fields and their type on the query against the temp table and they are fine.
Dim strQryFile As String
Dim strQryFileSql As String
Dim db As Database
Dim RecCounter As Integer
strQryFile = "DdTransTemp"
strQryFileSql = "SELECT * INTO DdTransTemp FROM DdSelectTransInRangeQry; "
DoCmd.SetWarnings False
DoCmd.RunSQL strQryFileSql
DoCmd.SetWarnings True
Dim rs As DAO.Recordset
Dim lUserID As Long
DBEngine.SetOption dbMaxLocksPerFile, 1000000
On Error GoTo ErrTrap
TaskCompletedFld = 0
Me.QryFile = strQryFile
lUserID = Me.UserIdFld.Value
Set db = CurrentDb
The last line is the one that creates the error. If I try to view it's contents (CurrentDb) in the immediate window I get the same thing
Anyone have any ideas about it.