Originally Posted by
June7
jgelpi16, there is an even number parens but maybe that pair is not needed.
Try the shorter WHERE clause, without the source string and table, just the field.
strSQL = strSQL & " WHERE ContractNo"
strSQL = strSQL & " In (SELECT UserAccess_T.[ContractNo]"
strSQL = strSQL & " FROM UserAccess_T WHERE [UserAccess_T].[F_KOCID] = " & TempVars!gUserID & ");"
Great! that's it.
Thank you very much both of you the above code did the tricks.
Code:
Dim strSQL As String
strSQL = "INSERT INTO tblItem_Local"
strSQL = strSQL + " SELECT tblItem.*"
strSQL = strSQL + " FROM [" & strSourcePath & "].tblItem"
strSQL = strSQL + " WHERE ContractNo"
strSQL = strSQL + " In (SELECT UserAccess_T.[ContractNo]"
strSQL = strSQL + " FROM UserAccess_T WHERE [UserAccess_T].[F_KOCID] = " & TempVars!gUserID & ");"
CurrentDb.Execute strSQL, dbFailOnError
Actually June7 is right, there is no need for the path again in the WHERE clause.
Thanks dude!