Adding values of diffrent fields

Kruger_jjp

New member
Local time
Today, 12:25
Joined
Sep 23, 2011
Messages
7
I have a one form that I use. On the form I have 7 diffrent fields that data can be put in. At the right hand site I have a Total Credits field that I want to change as the other fields change. Let me explain more this is to capture how many units of credit (pre-paid phone time was given to a person). So the field I have for example are Roshan 500; AWCC 500. If I put 2 for example in the Roshan field and one in the AWCC field. The total should show 1500. I also have this code on "change" for each field, as I want to enter the amount of scratch cards and not the amount of credits.

Private Sub AWCC_500_Change()

If AWCC_500 > 0 Then
AWCC5 = AWCC_500 * 500
Else
AWCC5 = 0

End If

End Sub

Private Sub Etisalat_500_Change()
Dim E5 As Integer
If Etisalat_500 > 0 Then
E5 = Roshan_500 * 500
Else
E5 = 0
End If

End Sub

In the Credits total field I want to add AWCC5 and E5 together.

I declared the variables as follows:-

Public AWCC5 As Integer
Public R5 As Integer
 
For me to have a go .
I would like to have the names of all your 7 fields, as i am having problems with your second sub .plus where do Public AWCC5 As Integer
Public R5 As Integer fit into the picture ?

which fields are credit and which are scratch card?

an example of some data in the seven fields and your expected out come for the total creits would be useful for anyone assisting you.
 
For me to have a go .
I would like to have the names of all your 7 fields, as i am having problems with your second sub .plus where do Public AWCC5 As Integer
Public R5 As Integer fit into the picture ?

which fields are credit and which are scratch card?

an example of some data in the seven fields and your expected out come for the total creits would be useful for anyone assisting you.
Hi Thanks for trying to help. I have uploaded the Access file for you to look at.
What I am trying to do do is to update the total Credit Total field when any of the seven fields becomes a value. Maybe I am trying to make it to difficult.
 

Attachments

i have played with it and have had some success , i have only looked at R5 AWCC5 R2 AND M2
 

Attachments

You are welcome, as a user like your self and not a pro it is very gratifying to receive feed back. Please click the thanks button ,which will improve my street credibility.

A further point the db will get bloated if you do not compact and repair on a regular basis. To automatically compact and repair on closure, just click the File button top Left Select options near the bottom of the list. Then: Current database. Check the compact on close tick box

Best of luck with your project
 
Last edited:

Users who are viewing this thread

Back
Top Bottom