Results 1 to 4 of 4
  1. #1
    JrMontgom is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Sep 2012
    Location
    Vero Beach, FL USA
    Posts
    124

    How to use Tempvars in query

    Hi I have a small problem and I can't solve it so Iwould really appreciate any help. I am creating a query on the "fly" in VBA. The date is the variable stored in Tempvars. I create the Tempars as follows:


    Tempvars.Add "tvStartDate",strStartDate. How do I express that in the Query Designer? I haveentered Tempvars("tvStartDate") but it says incorrect string. I have tried =Tempvars("tvStartDate") and get the same result? I get the strStartDate by either user input or from text box on form and it is valid in debug.print

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    I am familiar with but never used TempVars.

    Post the VBA code that constructs the SQL statement.
    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
    JrMontgom is offline Competent Performer
    Windows Vista Access 2010 32bit
    Join Date
    Sep 2012
    Location
    Vero Beach, FL USA
    Posts
    124

    Talking Using tempvars in query

    Quote Originally Posted by June7 View Post
    I am familiar with but never used TempVars.

    Post the VBA code that constructs the SQL statement.

    Thanks June but I found out that you need to put brackets around the Tempvars ex [Tempvars("tvData")] to get it to work
    Consider this solved (Now how tdo I mark it solved? hmmmm)

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Thanks for sharing the solution.
    Thread Tools dropdown above first post.
    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.

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

Similar Threads

  1. Replies: 10
    Last Post: 04-01-2014, 05:01 PM
  2. TempVars.add and make value ID
    By Ruegen in forum Programming
    Replies: 4
    Last Post: 12-31-2013, 06:19 PM
  3. Tempvars replace formname
    By Ruegen in forum Programming
    Replies: 8
    Last Post: 12-11-2013, 07:45 AM
  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

Tags for this Thread

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