G
Guest
ive got a form which totals up different costs depending on whether they have
been selected or not. If they have been selected they are given the value of
the textbox otherwise they are given 0.
The values are stored as InternetBill, ParkingBill, RentBill etc. This is
typical code (which works for what its supposed to do)
<!---
Private Sub Invoice_Click()
If Me![Invoice].Value = True Then
Me![invoiceComment].Enabled = True
Me![InvoiceAmount].Enabled = True
InvoiceBill = Me![InvoiceAmount]
Else
Me![invoiceComment].Enabled = False
Me![InvoiceAmount].Enabled = False
InvoiceBill = "0"
End If
-->
I need to update the Total depending on the value put into any of these
variables.
something like this:
<!--
Private Sub depositAmount_AfterUpdate()
Me![Total] = DepositBill + InternetBill + InvoiceBill + Otherbill + _
ParkingBill + RentBill + TelephoneBill
End Sub
-->
Ive tried using static variables put into the top of the form module and its
giving me errors when i use the event procedure, putting it into the sub
doesnt seem to store the value between subs.
how would i go about doing this? (or is there an better method?)
with much thanks
Amit
been selected or not. If they have been selected they are given the value of
the textbox otherwise they are given 0.
The values are stored as InternetBill, ParkingBill, RentBill etc. This is
typical code (which works for what its supposed to do)
<!---
Private Sub Invoice_Click()
If Me![Invoice].Value = True Then
Me![invoiceComment].Enabled = True
Me![InvoiceAmount].Enabled = True
InvoiceBill = Me![InvoiceAmount]
Else
Me![invoiceComment].Enabled = False
Me![InvoiceAmount].Enabled = False
InvoiceBill = "0"
End If
-->
I need to update the Total depending on the value put into any of these
variables.
something like this:
<!--
Private Sub depositAmount_AfterUpdate()
Me![Total] = DepositBill + InternetBill + InvoiceBill + Otherbill + _
ParkingBill + RentBill + TelephoneBill
End Sub
-->
Ive tried using static variables put into the top of the form module and its
giving me errors when i use the event procedure, putting it into the sub
doesnt seem to store the value between subs.
how would i go about doing this? (or is there an better method?)
with much thanks
Amit