I am new to Access and I seem to have run into a conundrum. I am currently using Ms Access 2007. I have a table setup with 12 fields and form with 12 fields which is corresponding to the 12 fields on the table.
The 12 fields on the form are combo box with setting
Row source: 1;"Yes";0;"No"
Column Count: 2
Column widths:0";2"
If I am correct, this allows the user to select Yes or No and have a corresponding values of 1 or 0 inputted in the table.
Now the real question is that I need to make a field that sums up the values from the 12 fields in the form and records it onto the table.
So far I have set the following up in the code builder
Expand|Select|Wrap|Line Numbers
- Private Sub Field1_AfterUpdate()
- Me.Total = Me.Field1 + Me.Field2 + Me.Field3 + Me.Field4 + Me.Field5 + Me.Field6 + Me.Field7 + Me.Field8 + Me.Field9 + Me.Field10 + Me.Field11 + me.Field12
- End Sub
- Private Sub Field2_AfterUpdate()
- Call Field1_AfterUpdate
- End Sub
I have a hunch I did something wrong in the code and would appreciate any help in solving the problem.
Also, I am willing to undertake any other methods other than code builder if it yields better results as long as the Total field sums the values of the fields 1-12 and records it in the table.