problem with SqLQuery in VBA

  • Here is code:


    Code
    SQLQuery "SELECT [a] FROM [b] WHERE [c]='" & strX  & "'", strFilePath, blnReturn, varArray


    but as you can see there is srtX which sometime is not active, when strX is not active, active is srtY.
    So is it possible to implement bout string this function, and function will use active one?
    something with OR...like this but not working... :(


    Code
    SQLQuery "SELECT [a] FROM [b] WHERE [c]='" & strX or strY & "'", strFilePath, blnReturn, varArray


    thx.

  • Re: problem with SqLQuery in VBA


    thx for advice, but I have more question.
    As strX can be Null, in same position can be strY, so function need to be working in bout direction even srtX is null or srtY is null.
    thx

  • Re: problem with SqLQuery in VBA


    Quote


    so function need to be working in bout direction even srtX is null or srtY is null


    if both criterias will be null then what will you pass in your query..

  • Re: problem with SqLQuery in VBA


    As mentioned previously...

    Quote

    srtX which sometime is not active, when strX is not active, active is srtY


    Which, I assume, means that if strX is null, then strY will contain something.

  • Re: problem with SqLQuery in VBA


    Yes you are right, one is "active", cannot be bout active string in same time (I will setup limitations before this function).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!