Results 1 to 2 of 2
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    assigning a variable

    If receiving a type mismatch error for the following code:

    dim straWarehouse As String
    straWarehouse = IIf(Nz(rsta.Fields(5)), rsta.Fields(5), "")



    When executing the code, value for rsta.Fields(5) is "Tempe"

    I don't understand what is causing this error. Can the Nz function only be used for variable types of variant?

  2. #2
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    I'm using ADO. Doing a google search, shows that Nz has a problem within ADO. I changed to using a IsNull function, and it is working properly.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 08-10-2011, 11:59 AM
  2. Assigning value to an image
    By cdzajp in forum Forms
    Replies: 1
    Last Post: 06-16-2011, 12:05 PM
  3. Assigning an Automatic PO #
    By nag3397 in forum Access
    Replies: 1
    Last Post: 01-27-2011, 02:22 PM
  4. Refering to variable form names inside a variable
    By redpetfran in forum Programming
    Replies: 2
    Last Post: 05-21-2010, 01:39 PM
  5. assigning probability
    By TheShabz in forum Programming
    Replies: 1
    Last Post: 05-06-2010, 12:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums