Hello here is the code that bothers me :
' where LNumevt is a global variable tested beforehand. Both LRefttst and LNumevt are global variable and both declared in a GenVal module
When I run this code I get an error messagebox N° 7874 stating impossible to find object 'SELECT....' where both global variable are in value.
Should I use info from Pat's Gen info I get the same kind of error.
My purpose is to see if a query with both global variables used as filter matches any record in the table.
Im starting to think Im not doing this properly but can't think of a better way at the moment given my lack of SQL skill.
Any pointers appreciated.
Code:
dim strSQL as string
LReftst = tst_idx (InRef) ' this is a global public function which returns a long
if LReftst <> 0 then
strSQL = " SELECT tbl_ctc_evt.[Idx Ctc], tbl_ctc_evt.[Idx evt] FROM tbl_ctc_evt WHERE tbl_ctc_evt.[Idx Ctc] = '" & LReftst & "' AND tbl_ctc_evt.[Idx evt]= '" & LNumevt & "';"
DomCmd.RunSQL strSQL
end if
When I run this code I get an error messagebox N° 7874 stating impossible to find object 'SELECT....' where both global variable are in value.
Should I use info from Pat's Gen info I get the same kind of error.
My purpose is to see if a query with both global variables used as filter matches any record in the table.
Im starting to think Im not doing this properly but can't think of a better way at the moment given my lack of SQL skill.
Any pointers appreciated.