Results 1 to 3 of 3
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    tempvar issue

    Hi



    In my database I use temporary variables and they work perfectly - I use them to set up search criteria via a form text box

    However had an issue reported by a user, so I went to my test pc and installed Access 2013 runtime and loaded my database.

    When I use the database the tempVar is setup perfectly and results are displayed as I expected.

    I have a button on the results form to "search Again" the button does the following

    1. Closes the results form
    2. Deletes the tempvar
    3. Loads the search form

    On my development machine it all works perfectly no problems at all BUT when I run the database on my test machine with a runtime version when I close the form I get the error message:

    The Command or action removeTempVar is not available . You may be in a readonly or an unconverted earlierversion of ... or The type of action the object refers to is not in the current view...

    I am at as loss as to why I only get this with the runtime version.

    Do I need to remove a tempvar prior to creating a new variable with the same name? I did it to be tidy

    Or does this show another issue

    thanks

    Ian

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,421
    Here's a workaround. In step 2, set the value of the tempvars!whatever = vbnullstring

    In all other code, before using the tempvar, first check if len(tempvars!whatever & vbnullstring) = 0 then ( do nothing, exit sub, else whatever )

    You do not need to remove tempvars to assign a different value. In fact you never really need to originally ADD the tempvar.
    Last edited by davegri; 04-23-2016 at 08:26 PM. Reason: code change

  3. #3
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi

    thanks for the info.

    cheers

    Ian

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

Similar Threads

  1. Syntax for TempVar to filter report (Web disastabase)
    By TheSnapperWhisperer in forum Access
    Replies: 0
    Last Post: 12-02-2015, 02:17 PM
  2. Replies: 7
    Last Post: 04-29-2015, 10:57 AM
  3. Wildcard / TempVar Criteria
    By mrmims in forum Queries
    Replies: 3
    Last Post: 04-08-2015, 04:12 PM
  4. tempvar update query date field
    By raffi in forum Queries
    Replies: 2
    Last Post: 09-27-2014, 11:51 PM
  5. Condition if there is a tempvar
    By Ruegen in forum Programming
    Replies: 1
    Last Post: 11-18-2013, 05:06 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