Extracting your query and composing it as follows:

SELECT usrid 
FROM tbmuser 
WHERE deptid='A3' 
  AND recstatus='Y' 
  AND usrid IN (
    'SELECT empno FROM rightmst
     WHERE formname ='mnuVendor' 
        AND newright='Y')

I discover that you have a single quote in front of
your second SELECT keyword which is most likely the
error if it occurs in your production code.

--- dasaga_phani <[EMAIL PROTECTED]> wrote:
> my query : 
> 
> how can i achieve this.
> ------------ code -----------------
> sqlstatuser = "select usrid from tbmuser where
> deptid='A3' and 
> recstatus='Y' and usrid in (" & _
> "'select empno from rightmst where formname
> ='mnuVendor' and 
> newright='Y')"
> Set rstusers = New ADODB.Recordset
> rstusers.CursorType = adOpenStatic
> rstusers.CursorLocation = adUseClient
> rstusers.Open sqlstatuser, cnn1, , , adCmdText
> ----------------
>  it is givint error at 'mnuvendor'
> 
> thankyou.
> phani
> 
> 
> 
> 



 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

Reply via email to