Results 1 to 3 of 3
  1. #1
    Dave_D's Avatar
    Dave_D is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    67

    Two issues - Passing in a parameter to this query; getting missing operator error

    In the following query, 1. I am getting a syntax error of missing operator starting on line 4 of the query starting with t1.Mon = t2.Sort INNER JOIN.... I have tried with and without adding parenthesis but can't seem to fine the right combination, if that truly is the issue. 2. How do you code the query to pass in the variable prmMarketValue? Lines 6 & 7 of the query are commented until issue 1 is resolved.

    If PVF_Type = "SCH" Then
    For i = 1 To 2
    prmMarket_Value = i
    'CurrentDb.QueryDefs.Delete "Q10All_SCH_StaffResults"
    sSql = "SELECT t1.PVF, t1.Market, t1.Manager, t1.Supervisor, t1.Sch_Q3,t1.Corp_ID, t2.Month, t1.Score " _
    &"INTO t75_StaffResults " _
    & "FROM (t10_PreVisit_Import_Scores t1 INNER JOIN " _
    & "t99MonthSort t2 ON t1.Mon=t2.Sort " _
    & "INNER JOIN t99Market t3 ON t1.Market = t3.Market "


    '& "WHERE t1.PVF = [Forms]![f03Reports]![cmbPVFsel] " _
    '& "AND t3.Market_Value) = prmMarket_Value"
    MsgBox (sSql)

    SetQDef = CurrentDb.CreateQueryDef("Q10All_SCH_StaffResults" , sSql)
    DoCmd.OpenQuery "Q10All_SCH_StaffResults"

  2. #2
    Dave_D's Avatar
    Dave_D is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    67
    Upon still messing around, I was able to resolve issue 1 with the missing operator error. So I'm just looking for a reply on passing that parameter.

  3. #3
    Dave_D's Avatar
    Dave_D is offline Advanced Beginner
    Windows XP Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    67
    I was not able to resolve issue 2 with & prmMarketValve & "".

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

Similar Threads

  1. Replies: 4
    Last Post: 03-16-2016, 12:24 PM
  2. Replies: 2
    Last Post: 09-10-2014, 11:30 AM
  3. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  4. Replies: 9
    Last Post: 01-22-2013, 04:23 PM
  5. Replies: 6
    Last Post: 05-30-2012, 12:32 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