Okay before the nitty gritty code part I shall try and explain what I am trying to acheive!
I am trying to make a form that will display the 'kWh' used per month per site.
I have a table of data from suppliers that details the amount used, the start date of the bill and the end date of the bill.
What I would like to acheive would be to get the kWh to display in the end month but have dashes in all the months it covers.
EG 246 kWh used in Jan Feb Mar and Apr.
I would like it to look like:
Jan |Feb |Mar |Apr
- | - | - |246
Right now I can get the kWh to display in the end month using End_Date but I cannot make the dashes go in the months before this.
I created another field called 'Period' (which is End_Date -1day) and tried to the code below to make it work:
But this isn't doing anything to my data. I think maybe I am doing the complete wrong thing here so if anyone can point me in the right direction I would be grateful.
Hope that all made sense!
I am trying to make a form that will display the 'kWh' used per month per site.
I have a table of data from suppliers that details the amount used, the start date of the bill and the end date of the bill.
What I would like to acheive would be to get the kWh to display in the end month but have dashes in all the months it covers.
EG 246 kWh used in Jan Feb Mar and Apr.
I would like it to look like:
Jan |Feb |Mar |Apr
- | - | - |246
Right now I can get the kWh to display in the end month using End_Date but I cannot make the dashes go in the months before this.
I created another field called 'Period' (which is End_Date -1day) and tried to the code below to make it work:
Code:
Private Sub Form_Load()
'Display kWh or a dash if it falls between a
'period when the form loads
If IsNull(kWh) Or kWh = "" Then
If Start_Date < Period Then
kWh = "-"
End If
End If
End Sub
But this isn't doing anything to my data. I think maybe I am doing the complete wrong thing here so if anyone can point me in the right direction I would be grateful.
Hope that all made sense!