Search results

  1. D

    pass control name as variable

    Magic! Thanks
  2. D

    pass control name as variable

    Thanks for the response Yes that is the line that's causing me issues. Having changed it to match your code i still get "invalid use of me keyword." for reference this is the calling sub Private Sub cmdNPT_Click() Call insertNPTMonths("Crimes_Committed_Formatted"...
  3. D

    pass control name as variable

    Hello, I have the following piece of code, which is causing me a bit of grief at the moment. How do i pass a variable (labelName) to be used as a control name? For reference, i have labels that will become visible when the following code is executed by clicking on the corresponding control...
  4. D

    Returning Null Values

    Thanks Neil, I've tried the following SQL but it's giving me results that are quite obviously wrong. Query 1 SQL SELECT Orders.DateRange, Sum(Orders.No_Of_Orders) AS SumOfOrders FROM Orders GROUP BY Orders.DateRange HAVING (((Orders.DateRange)<=8 And (Orders.DateRange)>0)); Query2 SQL...
  5. D

    Returning Null Values

    Cheers Neil, But you might have to teach me how to suck eggs on this one! Let me See if i've got this right. I create query A with dataRange and SumOfNo_Of_Orders in it then i use that in another query that has my priority criteria in it. Which query should the calculated field be in...
  6. D

    Returning Null Values

    Thanks for your reply Brian. Is there anyone else out there that can assist with this problem? Thanks
  7. D

    Returning Null Values

    Returning Null Values as Zero Hello I have three fields in a query all from the same table. The Fields are: DateRange, No_Of_Orders, Priority DateRange contains integers from 0 to 11, No_Of Orders is a number field, and Priority contains either 'Y' or 'N'. What i want to do is sum...
  8. D

    Basic Group By Month problem

    Thanks bob, How do i then turn the integar value the month function returns into "mmm" Do i use the format function? How do i combine that with the Month function? Thanks for your help
  9. D

    Basic Group By Month problem

    Hello, This is a real Access 101 problem i'm having. I've got two years worth of data, that i need to group first by Year, and then by each month in the year. The issue i'm having is that the query groups by year no problem, but it then groups each month in alpabetical order (ie; Apr,Aug...
  10. D

    Can't find the field '|' referred to in your expression

    i've got the follwing function in my VBA code that is throwing out the error Can't find the field '|' referred to in your expression. Is their something wrong with my syntax? Dim LTotalF As Long LTotalF = DCount("Cri_Ref_No"...
  11. D

    Combining Multiple update queries into one SQL Statement

    Worked like a chamr. Thanks man. Final Sql UPDATE Recorded_Crime_Committed_Formatted SET Previous7 = IIf(Cri_Committed_Date Between Forms!frmMain!prev7Start And Forms!frmMain!prev7End+1,True,False), Current7 = IIF(Cri_Committed_Date BETWEEN Forms!frmMain!cur7Start And...
  12. D

    Combining Multiple update queries into one SQL Statement

    Sorted the syntax error out.
  13. D

    Combining Multiple update queries into one SQL Statement

    Short answer - Because i'm near useless with SQL! it comes up with a syntax error in the first IIF statement. Thank you for all your help thus far.
  14. D

    Combining Multiple update queries into one SQL Statement

    I'm not sure i understand. The data is used as a record source for excel pivot tables. The reaon we need to set the value to true, is so that users of the pivot tables can easily filter out records that were not in the last 7, 14, 28, or 56 days.
  15. D

    Combining Multiple update queries into one SQL Statement

    Hello, I have multiple update queries that i would like to combine into one statement for performance reasons. I know you can update multiple columns in an update query, but the problem is all the statements have different WHERE clauses. I'm assuming this would be solved by using subqueries...
  16. D

    Need to Autorun an Append Query

    Convert your Macro into VBA code ,and add: docmd.SetWarnings False Insert rest of Code here docmd.SetWarnings True If you don't turn the warnings back on you'll not get error messages that you might want to be warned about!
  17. D

    Syntax Error in Query

    That work's but now i've struck another problem. I want the query to return results grouped by Date within the date range that i've sepecified. I tried putting order by dateofaction within the subquery, like below. SELECT StationGroup.StationGroupName, Stations.StationName FROM Stations LEFT...
  18. D

    Syntax Error in Query

    Hello, I got the 'syntax error' in the following query. The query works fine when i look for items that don't appera in the list on ONE particular day, but when i look for items that don't appear in the list within a given date range, the query falls over SELECT...
  19. D

    Problem with SQL statement in VBA

    Getting rid of the parentheses seemed to do the trick. Thank you very much!
Back
Top Bottom