Gregorys05
Board Regular
- Joined
- Sep 24, 2008
- Messages
- 217
Hi guy's
I am trying to run the below query but keep getting:
___
Run time error 3067
Query input must contain at least one table or query
___
but have no idea why as the query run fine in the query builder but will not run in VBA??
Any ideas
CODE:
Thanks
I am trying to run the below query but keep getting:
___
Run time error 3067
Query input must contain at least one table or query
___
but have no idea why as the query run fine in the query builder but will not run in VBA??
Any ideas
CODE:
Code:
Set QDF = DB.CreateQueryDef("", "INSERT INTO NotePadOutput ( NotepadArea, NotpadGenericcode1, AttributeCode1, NotepadInstruction, NotepadLink, NotepadType )" & _
"SELECT tblimageuploadcheck_1.NotepadArea, Left([Fname],7) AS ASSETID, IIf([notepadarea]='ASSET','',[ATTCODE]) AS AttributeCode1, 'A' AS NotepadInstruction, [FPath] & [FNAME] AS NotepadLink, 'L' AS NotepadType" & _
"FROM (SELECT Files.Fname, Files.FPath, Files.DateCreated, Mid(Files.Fname,IIf(InStr(Files.Fname,'-')=0,1,InStr(Files.Fname,'-'))+1,IIf(InStr(Files.Fname,'.')=0,1,InStr(Files.Fname,'.'))-IIf(InStr(Files.Fname,'-')=0,1,InStr(Files.Fname,'-'))-1) as ShortFname" & _
"FROM Files). AS tblFormattedFileSNotepad INNER JOIN tblimageuploadcheck AS tblimageuploadcheck_1 ON tblFormattedFileSNotepad.ShortFname = tblimageuploadcheck_1.Code" & _
"WHERE (((tblimageuploadcheck_1.NotepadArea)='ASSET'));")
QDF.Execute
Thanks