dmorgan20
dmorgan20

Reputation: 363

Setting Axis to Time using VBA

I have spent some time researching this but no idea if I am on the right track of not so thought I would ask for help.

I have a graph in access that changes depending on what option is selected from a drop down menu - One option involves HH:NN:SS, so I need to change the format of the graph to allow it as at the moment its showing as total number of seconds instead.

Code:

ElseIf MetricList = "Telephony - Busy Time" Then
TrendGraph.RowSource = "SELECT (Format([WC_Date],'yy  ww')) AS Week, tbl_Genesys_Weekly.Field5, Sum(tbl_Genesys_Weekly.Field44) AS SumOfField44 FROM tbl_Genesys_Weekly GROUP BY (Format([WC_Date],'yy  ww')), tbl_Genesys_Weekly.Field5 HAVING (((tbl_Genesys_Weekly.Field5)='User'));"

I have been trying: Trendgraph.axis but this does not bring up any property fields so can assume I am completely wrong at this stage

Any help is appreciated

Upvotes: 0

Views: 17

Answers (1)

Gustav
Gustav

Reputation: 55961

If this is your minute count:

Sum(tbl_Genesys_Weekly.Field44)

you can get a time value with TimeSerial:

TimeSerial(0, Sum(tbl_Genesys_Weekly.Field44), 0)

and then format this as you like, for example:

Format(TimeSerial(0, Sum(tbl_Genesys_Weekly.Field44), 0), "hh:nn:ss")

Upvotes: 1

Related Questions