Hi,
I have an small old Access application, my VBA is using a lot of Queries - all types.
I am trying to make some changes that will allow some day to go Web based. Most of the queries have been transformed to VBA code, using the DoCmd.runSQL statement, but now I am starting with some of the more complex ones - an here is a problem:
My sql string is like this:
I need to insert 3 colums , the UNIQ goes to RefNo, PP_Sec goes to SecPro and the 3rd into DEscr. The problem obviously is with the Descr, as it is a result of 2 fields from 2 different tables : FirstNo from the basic table (tblInitial, and FirstText vrom C0_texts ) . the result is (for example) : 12 (Switch of!) .Code:strSQL = "INSERT INTO tblNewData (RefNo, SeqProc, Descr ) SELECT tblInitial.UNIQ, tblInitial.PP_Seq, [FirstNo]" & " (" & [FirstText] & ")" & "AS Txt1 FROM tblInitial LEFT JOIN C0_texts ON tblInitial.txtType = C0_texts.txtCode;"
As a query it works perfect, but as a SQL statement I get an error : " Appl can't find the field '|1' referred to in your expression"
I am new in creating the Sql string, and maybe there is an error in my string, although the debugger accepts it ... I have just copied the SQL from the Query ...
As a query it works perfect, but as a SQL statement I get an error : " AppName can't find the field 'I1' referred to in your expression"