Recent content by tmercier

  1. T

    Calculate Median

    I am attempting to calculate the Average & Median on a particular field in a query. =Median("qry2007_KPI_AvgJan_A","ContractSignedToReceived") query name is qry2007_KPI_AvgJan_A field name is ContractSignedToReceived I am getting #Name? error. Any ideas why? Thanks for any help...
  2. T

    Grouping For Output to Email

    Hi there, I have 2 parameters that I need to group by... by Install SP and by Line item. I want all Line Items that have are linked to an Install SP to be grouped together in the email. I am able to get the data grouped but the Install SP is duplicated in the output. An example of what I...
  3. T

    Join Queries

    If the 3 queries have the exact same fields in each then another option is to use an SQL Select Union All query. Sample Code: SELECT * FROM PriceListUS UNION ALL SELECT * FROM PriceListCdn;
  4. T

    SQL statement in VBA

    Thanks for the tips :-) I walked away from this yesterday and came in with fresh eyes and found the errors I had an extra comma (,) just before the FROM clause and during all my changes removed the space before the word FROM. It works now :-) SQL = "SELECT tblHeader.[Transaction...
  5. T

    SQL statement in VBA

    Thanks for your help :-). I'm going a bit batty right now Debug.Print code: SELECT tblHeader.[Transaction Number], tblDetails.[Installation Order Number],tblDetails.[Item Number], tblHeader.BP, tblDetails.[Order Quantity], tblDetails.Material, tblDetails.[Line SOI Date],tblDetails.[Material...
  6. T

    SQL statement in VBA

    I can get it to work in the query window... just not in VBA. Here's the code that works in the query window. When I convert it to what VBA likes (adding the & signs and the underscores) I get errors SELECT tblHeader.[Transaction Number], tblHeader.BP, tblHeader.[Ship-to Party]...
  7. T

    SQL statement in VBA

    Thanks for catching that! But it's still not working :-( This is what I'm getting now but I don't know how to read it to know where to look for the error. Debug.Print SQL SELECT tblHeader.[Transaction Number], tblHeader.BP, tblHeader.[Ship-to Party], tblHeader.[CAM: Street],tblHeader.[CAM...
  8. T

    SQL statement in VBA

    Sigh! I just can't find the error :-( SQL = "SELECT tblHeader.[Transaction Number], tblHeader.BP, tblHeader.[Ship-to Party], tblHeader.[CAM: Street]," _ & "tblHeader.[CAM: District], tblHeader.Region, tblDetails.[Installation Order Number]," _ & "tblDetails.[Item...
  9. T

    SQL statement in VBA

    I'm not following you???? Do you mean add a space after the Where statement? If yes, I did that... not sure why it doesn't show in the code I pasted but I double checked and it is definately there.
  10. T

    SQL statement in VBA

    Thanks for the tip! I'm new to this so am not aware of debugging tools. Here's what I get when I run debug in the immediate window... I don't see anything wrong though ;-( SELECT tblHeader.[Transaction Number], tblHeader.BP, tblHeader.[Ship-to Party], tblHeader.[CAM: Street],tblHeader.[CAM...
  11. T

    SQL statement in VBA

    Yes, it does work in the query environment. The problem seems to occur during the translation into vba at the 'where' statement.
  12. T

    SQL statement in VBA

    I've tried but am still getting a run-time error 2147217900 The Select statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. Here's my latest changes but I can't find where the error is. & " FROM (tblDetails INNER JOIN...
  13. T

    SQL statement in VBA

    I am attempting to edit code that was written by a different developer (I'm not familiar with SQL) to include a field from another table 'tblInstallSummary'. How do I edit the SQL statement to reflect this? I've bolded my attempt below but I am just getting an error. Thanks to anyone who can...
  14. T

    auto resize subform

    I'm interested in any info as I am trying to do this same thing as well.
  15. T

    appending to end of Line description

    This is exactly what I was looking for! Thanks for the speedy response :-)
Top Bottom