Search results

  1. C

    Sort Mainform based on earliest date on subform?

    I have a form which shows training events - these can take place over one or several days, and can be run by one trainer or several, so I have my basic Events Info in one table (EventID, EventType, Location, that kind of thing) and the 'Jobs' in a separate table (EventID, JobDate, TrainerID...
  2. C

    Returning a Difference Between Date/Time Values in HH.MM Format

    ok there must be something different in your settings, as mine shows decimals.... eg 1.50, 4.00, 6.25... then again, I was just doing the calculation in a query rather than in SQL...
  3. C

    Returning a Difference Between Date/Time Values in HH.MM Format

    When you say you want it in decimal format - do you mean you would want 30 mins to show as 0.50, and 45 mins as 0.75 ? Because if that's the case, surely it's dead easy? ActualManHours=format((txtEndTime-txtStartTime)*24,"standard")
  4. C

    Find last day of month from a date field

    I use Public Function LastDayOfMonth(ByVal datDate As Date) As Date LastDayOfMonth = DateSerial(Year(datDate), Month(datDate) + 1, 0) End Function
  5. C

    Refer to aggregate function in WHERE clause (AC2007)

    An Aggregate function is normally when you group by something, and then work out the sum, or average, or count, or max / min etc of something else based on what you've grouped on. For example, if you wanted to work out the number of Orders a company had placed - you could group by the company...
  6. C

    Refer to aggregate function in WHERE clause (AC2007)

    see my post above..... you can't put criteria on a calculated field that way - you have to put the criteria on the calculation itself!
  7. C

    Refer to aggregate function in WHERE clause (AC2007)

    As Paul said, that's not an aggregate function, it's just a calculation - so you should be able to just replace your WHERE statement with WHERE (((([tblBalances].[Amount]*[tblRates].[FXRate]))>1000) AND ((tblBalances.[BalanceDate])=#12/10/2013#));
  8. C

    Need Custom Function

    Admittedly, it's harder to maintain and easier to get the syntax wrong, but for someone not familiar / comfortable with writing code, potentially quicker.... just wanted to offer it up as an alternative ;)
  9. C

    Need Custom Function

    never even thought about it, Paul... just carried on using Now as that's what had been used earlier in the thread! Wrists duly slapped and earlier post being edited ;)
  10. C

    Need Custom Function

    In a query, you could try Yrs: IIf([Establishedyear]<1981,Year(Date())-1981,Year(Date())-[Establishedyear]) Points: IIf((Year(Date())-[Establishedyear])<10,(Year(Date())-[Establishedyear])*2,20+((Year(Date())-[Establishedyear]-10)))
  11. C

    Question Front page to my Database

    It should be under the developer tab, if you're using 2007 like me ;) Otherwise - I'm not sure! On earlier versions, it could be under Tools?
  12. C

    Question Front page to my Database

    ... or depending on which version of Access you are using, you could use the Switchboard Manager tool to build a Menu / Switchboard for you?
  13. C

    Number of days calculation

    That was going to be my next suggestion, if the first bit worked ;)
  14. C

    Query Design Need Help

    try this.... it could probably be done in a more streamlined way as this needs all 3 queries.... just import them all into your database ;) and then run qryBandsEarningsPerMember
  15. C

    Number of days calculation

    THis may not give you the whole solution but maybe it'll point you in the rigt direction? Assuming your controls are txtCommenceDay and txtFinalDay: Private Sub txtFinalDay_AfterUpdate() If Not IsNull(Me.txtFinalDay) And Me.txtFinalDay< Me.txtCommenceDay Then MsgBox "Final...
  16. C

    Comob box filter

    screen.activecontrol = the control on the screen that's currently active - in this case. my cboTrainer (combo box) So it looks for the value that I've just selected in the combo... just makes it easier if you forget and rename the control afterwards ;)
  17. C

    Comob box filter

    I have this on one of my forms, and it works.... it's on the cboTrainer_AfterUpdate Private Sub cboTrainer_AfterUpdate() Form.Filter = "[TrainerID] = " & Str(Nz([Screen].[ActiveControl], 0)) Form.FilterOn = True End Sub
  18. C

    Picking up wrong record

    Question: why are you storing both the City and Province in your Installations table? You'd be better adding a unique ID to the Cities table, maybe calling it CityID, and then storing that in the Installations table - you can then lookup / display up the City and Province using the CityID...
  19. C

    Calculate 28 days of mileage

    Depends what is being stored as the mileage on each date? If it's the Odometer reading, then you should be able to just take the reading on the 'entered date' away from the reading 28 days after..... But if it's how many miles driven since the last reading, then yes, they'll need to sum them :)
  20. C

    Help with command button to open datasheet of contact names

    is your button called command48, or contacts? and when you look at its event properties, does it say [event procedure] in the On Click event?
Back
Top Bottom