Hi there everybody;
Fresh from reading my Access VBA for Dummies, I'd like to update my database about activities on a school outing.
Here's what I'd like to achieve.
The school outing costs money - nothing's for free these days.
The prices for the individual activities are stored in tbl.prices; in this table,
there are 3 fields: PriceID, Amount, Description
and 4 records: a record for the morning activity
a record for the afternoon activity
a record for the transport costs
a record with the amount 0.00, for those who don't take part
Based on this tabel is a query, named qryCharges with only one field, namely SumofAmount.
Now for the tricky bit, well for me it's tricky anyway.
The report I'm working on at the moment is essentially a notification letter, informing participants of how much they've paid so far and how much is still outstanding. Easy enough, as I've got that data stored in a table but I don't much like the fact that participants have to read: " You now need to pay $0.00." when they've already paid everything.
Therefore, I'd like to play around with the visible-property of label8, which contains the text "you now need to pay...." as well as the visible-property of the field 'total_now_due' , contained on the report.
My first thought was to attach the code to the individual controls, i.e. the label8 and the field 'total_now_due' , but for some reason, I seem to be unable to enter anything in the Event-Tab when viewing their properties. So, I thought I'd put the code into the report properties but that doesn't quite seem to work either.
Here's my effort:
Private Sub Report_Open(Can cel As Integer)
If Total_now_due = qry_charges!sum ofAmount Then
repParentsInfo! Total_now_due.V isible = False
repParentsInfo! Label8.Visible = False
Else: repParentsInfo! Total_now_due.V isible = True
repParentsInfo! Label8.Visible = True
End If
End Sub
Any ideas?
Thanks for reading, anyway
Fresh from reading my Access VBA for Dummies, I'd like to update my database about activities on a school outing.
Here's what I'd like to achieve.
The school outing costs money - nothing's for free these days.
The prices for the individual activities are stored in tbl.prices; in this table,
there are 3 fields: PriceID, Amount, Description
and 4 records: a record for the morning activity
a record for the afternoon activity
a record for the transport costs
a record with the amount 0.00, for those who don't take part
Based on this tabel is a query, named qryCharges with only one field, namely SumofAmount.
Now for the tricky bit, well for me it's tricky anyway.
The report I'm working on at the moment is essentially a notification letter, informing participants of how much they've paid so far and how much is still outstanding. Easy enough, as I've got that data stored in a table but I don't much like the fact that participants have to read: " You now need to pay $0.00." when they've already paid everything.
Therefore, I'd like to play around with the visible-property of label8, which contains the text "you now need to pay...." as well as the visible-property of the field 'total_now_due' , contained on the report.
My first thought was to attach the code to the individual controls, i.e. the label8 and the field 'total_now_due' , but for some reason, I seem to be unable to enter anything in the Event-Tab when viewing their properties. So, I thought I'd put the code into the report properties but that doesn't quite seem to work either.
Here's my effort:
Private Sub Report_Open(Can cel As Integer)
If Total_now_due = qry_charges!sum ofAmount Then
repParentsInfo! Total_now_due.V isible = False
repParentsInfo! Label8.Visible = False
Else: repParentsInfo! Total_now_due.V isible = True
repParentsInfo! Label8.Visible = True
End If
End Sub
Any ideas?
Thanks for reading, anyway
Comment