Moving TempVar value into a table using a query.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shawn29316
    New Member
    • Feb 2007
    • 33

    Moving TempVar value into a table using a query.

    Hi,

    I have a query that says:
    Code:
    Select Distinct Bids.EmpID, Bids.PosID, [tempvars]![reqnum] AS ReqNum From Bids;
    The query works fine until I try to use it to populate a table, then the ReqNum field is always blank. The only thing I did different in the query was to place "INTO EmpBIDs" before the "From Bids" in the original query.

    Is placing a tempvar value into a table using a query doable?

    Thanks,
    Shawn
  • jforbes
    Recognized Expert Top Contributor
    • Aug 2014
    • 1107

    #2
    I don't use TempVars often, but I would think that the TempVar would be evaluated correctly.

    You could try to create a Function to return your TempVar and then use the Function in your Query to see if your problem goes away.


    VBA:
    Code:
    Public Function getReqNum() As Variant
        getReqNum = TempVars.Item("reqnum")
    End Function

    Query:
    Code:
    Select Distinct Bids.EmpID, Bids.PosID, getReqNum() AS ReqNum From Bids;

    Comment

    Working...