Search results

  1. T

    Requery Method

    Rather embarrassingly, the following works perfectly: Private Sub tBlade_AfterUpdate() Me.test.SetFocus testresults DoCmd.GoToRecord , , acLast DoCmd.GoToRecord , , acPrevious, 14 End Sub Many thanks for all the suggestions.
  2. T

    Requery Method

    I cannot get VBA to recognise the recalc method, but logically this will only recalculate fields, I am loading rows of data and my change to the main-form may bring in more entries which recalc cannot do? I am not sure how to define a specific record and then reference how to go to it, I seem...
  3. T

    Requery Method

    I am trying to open a continuous sub-form from a query that interacts with items on the main-form, hence when I change something on the main-form I need to re-load the sub-form. This may seem painful and inefficient but is necessary for the overall function. I am setting a record key...
  4. T

    Requery Method

    Yes, that is the point. I am doing a major action query and the requery method does this perfectly and as you say resets it to record one, I would like to then move it to the fifteenth from last as per my load event.
  5. T

    Requery Method

    Hi, I have a sub-form with a load event as follows: Private Sub Form_Load() testresults DoCmd.GoToRecord , , acLast DoCmd.GoToRecord , , acPrevious, 14 End Sub This runs a complex query of data (in a public module) and loads the sub-form as a continuous form with the last fifteen records...
  6. T

    Requery Form when Activated

    It is normally because you are still in the record and it hasn't saved yet. One easy check is to put a button on the form that requeries the data, this will confirm this.
  7. T

    edit record in new form

    If you allow data edits in the properties of the sub form you can edit them without problem.
  8. T

    Duplicate a record from an Access form

    [CODE]DoCmd.RunSQL "INSERT INTO tblQuoteCost ( Quote, Flight, Total,) " & vbCrLf & _ "SELECT [Forms]![frmQuote]!
  9. T

    Simple SQL

    Many thanks for that, it was the first thing I tried yesterday and I had tried every possible variation thereafter on the assumption that it didn't work. Somebody confirming that it was correct made me look a bit further and I found it was being removed later in the code for a different...
  10. T

    Simple SQL

    I have a simple piece of SQL which changes something when something else starts with PQ: DoCmd.RunSQL "UPDATE LogFile SET LogFile.Field3 = Replace([LogFile]![Field3],""AGB"",""4GB"") " & vbCrLf & _ "WHERE (((LogFile.Field3) Like ""AGB*"") AND ((LogFile.Field8) Like ""PQ*""));" I want to change...
  11. T

    query don't run from vba

    You probably have saved it properly now, switching from design view to form view doesn't necessarily do this.
  12. T

    Running Average in Query

    Hi CJ, Many thanks for this, works perfectly, I just need to work out why now (for my personal education).
  13. T

    Running Average in Query

    I think this is where I am missing something, attached is the original with the table and QSum query. If I try to create a query as follows, it refuses to save due to the Between issue.
  14. T

    Running Average in Query

    It may just be me being thick! I have also attached a mock-up.
  15. T

    Running Average in Query

    Many thanks for this CJ but I am getting an error: Between operator without And in query expression..............
  16. T

    Running Average in Query

    The original query does this anyway and produces a set of records such as the following: 2018 01 125.00 2018 02 700.00 2018 03 420.00 My problem is working out how to average the last twelve values from this and also how to avoid an error when there are not enough values as below...
  17. T

    Running Average in Query

    I have a query which gives me monthly figures, what I want to do is get a running annual average. SELECT Sum(tblOrders.Value) AS SumOfValue, Format([tblOrders]![Date],"yyyy mm") AS Expr1 FROM tblOrders GROUP BY Format([tblOrders]![Date],"yyyy mm") ORDER BY Format([tblOrders]![Date],"yyyy mm")...
  18. T

    VBA Date Query

    Well, thanks PBaldy, I did similar but added the correct seconds rather than minutes as follows: BETWEEN Forms!frmMain!tStartDate And DateAdd('s',86399, Forms!frmMain!tEndDate) All seems to work perfectly and the loss of a single second can't matter (?) as if you add it on it is 00:00 on the...
  19. T

    VBA Date Query

    Odd one here, I have a table with a date and time stored as a General Date. I am importing data from text files where old ones have just a date so it comes in as 01/01/2018 00:00 and new ones with a time so it is imported as 01/01/2018 15:20. If I want to query a date range of old data I have...
  20. T

    On Load Event of Report

    Thanks to Banana in 2006.
Back
Top Bottom