Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,946
    So you set the tempvar to a null value,as Me.txtpermission had no value?


    Walk through the code LINE BY LINE with F8 and hover over the variables to see what they contain.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  2. #17
    Ant_Snell is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2021
    Location
    UK
    Posts
    118
    @Welshgasman Thanks I'll give that a go this evening but got to go out now. Thanks for all the help

  3. #18
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,946
    Ignore this post
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #19
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    I may be missing it but where are you setting the value of Me.txtPermission?

    I would expect to see
    Code:
    me.txtPermission = ab.Permission
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  5. #20
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    integers and strings can't contain Null.You can also use the Nz function to replace Null with an empty string if referred to as a string, or 0 if referred to as an integer.

    You could try

    1: If Me.txtPermission.Value is a string

    Code:
    if nz(Me.txtPermission.Value,"") ="" then
     msgbox "txtPermission has no value"
    else
       TempVars.Add "UserPermission", Me.txtPermission.Value
    MsgBox TempVars![UserPermission]     
    end if
    2: If Me.txtPermission.Value is a number

    Code:
    if nz(Me.txtPermission.Value,0) =0 then
     msgbox "txtPermission has no value"
    else
       TempVars.Add "UserPermission", Me.txtPermission.Value
    MsgBox TempVars![UserPermission]     
    end if

  6. #21
    Ant_Snell is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2021
    Location
    UK
    Posts
    118
    Using combinations of all help/suggestions, I have now got this sorted. Thanks

  7. #22
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 06-23-2020, 10:37 PM
  2. How to use Tempvars in query
    By JrMontgom in forum Programming
    Replies: 3
    Last Post: 09-03-2014, 12:36 PM
  3. TempVars.add and make value ID
    By Ruegen in forum Programming
    Replies: 4
    Last Post: 12-31-2013, 06:19 PM
  4. TempVars monitoring for debug
    By chris.williams in forum Programming
    Replies: 2
    Last Post: 11-18-2011, 03:27 PM
  5. Using TempVars in query
    By jonesy29847 in forum Programming
    Replies: 3
    Last Post: 03-03-2011, 11:07 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