Results 1 to 2 of 2
  1. #1
    HansBades is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Dec 2021
    Posts
    85

    set variable to null


    I have a listbox with a delete button next to it. When someone clicks on an item in the listbox and presses the delete button, it removes the item from the list. In my code associated with the delete button, I name the selected item from the list box as the variable itemtodelete. At the end of the routine I am trying to set the variable to null. I have tried both 1) itemtodelete = "" and 2) itemtodelete = null. But it doesn't work. The variable itemtodelete retains the value that was last clicked on in the listbox even though it is no longer there. How can I reset the variable? Thanks.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Just curious, could you requery the form or a specific control on the form?
    Perhaps show readers the vba code involved.

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

Similar Threads

  1. recordset value failing on null variable
    By gangel in forum Modules
    Replies: 4
    Last Post: 08-04-2015, 05:25 AM
  2. Replies: 1
    Last Post: 08-03-2014, 07:48 PM
  3. Help with a Null Variable Issue
    By EDNYLaw in forum Access
    Replies: 6
    Last Post: 03-26-2013, 10:56 AM
  4. Control variable is Null
    By ngruson in forum Access
    Replies: 2
    Last Post: 04-21-2010, 10:27 AM
  5. List box value to variable - invalid use of null?
    By Orabidoo in forum Programming
    Replies: 2
    Last Post: 05-07-2009, 11:06 AM

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