+ Reply to Thread
Results 1 to 3 of 3

Treat empty variable - Excel VBA

  1. #1
    Registered User
    Join Date
    12-19-2012
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    3

    Treat empty variable - Excel VBA

    Dear,

    I would like to know how to treat an empty variable in an expression that sql query a table access 2007.

    I've read some articles about using the IS NULL and IS NOT NULL and made ​​a few unsuccessful attempts.

    I tried and did not work well:

    Please Login or Register  to view this content.
    In my example, the variable3 is empty.

    Anyone know how to say the words correctly write?

    Sorry if I wrote it wrong.

    At
    Last edited by Alvim; 12-20-2012 at 07:13 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Treat empty variable - Excel VBA

    Do you actually need variable3 in the SQL if it's empty?

    If you don't you could try something like this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-19-2012
    Location
    Belo Horizonte, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Treat empty variable - Excel VBA

    Quote Originally Posted by Norie View Post
    Do you actually need variable3 in the SQL if it's empty?

    If you don't you could try something like this.
    Please Login or Register  to view this content.
    It was exactly that.

    Thank you.

    At

    Alvim

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1