Results 1 to 5 of 5
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    TempVars.add and make value ID

    I'm using TempVars.Add so I can make a new stored Temporary Variable

    The goal is to store the forms record ID (table ID)

    I'm stuck on the expression.

    TempVars.Add (name,value)

    I thought it would be

    TempVars.Add (tmpCopyID, me.SchoolID)

    I get a compile error Expected:=



    I've found a solution which doesn't use tempvars however I would still like to know the answer to this...
    Last edited by June7; 08-18-2013 at 09:18 PM.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,959
    The variable name must be provided as a string, so try:

    TempVars.Add ("tmpCopyID", Me.SchoolID)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    *smacks own head*

    thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,959
    Been there, done that
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    MarvinM's Avatar
    MarvinM is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    30

    Thumbs up More info on syntax

    Quote Originally Posted by June7 View Post
    The variable name must be provided as a string, so try:

    TempVars.Add ("tmpCopyID", Me.SchoolID)
    I got an error when I used the parentheses. No error without. Try this:

    TempVars.Add "tmpCopyID", Me.SchoolID

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

Similar Threads

  1. Replies: 0
    Last Post: 07-11-2013, 02:21 PM
  2. How to make drawing
    By Suspecious in forum Access
    Replies: 1
    Last Post: 04-09-2013, 11:28 AM
  3. TempVars monitoring for debug
    By chris.williams in forum Programming
    Replies: 2
    Last Post: 11-18-2011, 03:27 PM
  4. Replies: 6
    Last Post: 08-27-2011, 03:47 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