Would you please help me to see the attached database
Data presented in the following format
ID	Section No	Field No	Field Value	Form Value	Calc Number	Answer
1	 1	 1	 0.5	 No		 False
Field "Answer" was provided in the format "Yes/No".
The database reflects various records for various sections. The goal is to calculate Combined Field Value for the entire sections and put it based on the provided field value for all records which have form value "Yes". The results should be inputted to the field "Calc Number" only to the record of the section which reflect Answer value as "True". Please see attached database for the details.
Suggestions to do
1) Determine section value from the form by using me.txtSectionNo.
2) Input provided code into variable
3) Create 2 loops:
3.1 First loop is outside loop which go through sections. Loop should increment section number
3.2. Inside loop should go through all records within the section of the form. Get all values for records which have form value (txtformvalue) as "Yes" withing the section, summarize field value (txtfieldvalue) and input it to the Calculated field txtcalcNo only for record which have hidden field txtanswer as "true". This can be done by using either form or database connection
4. Validate that all required records have Combined Calculated Field for the section. Form should show value with current record, before or after update
I have some suggestions of the code. Please review and fix especially loop parts and test the form in the provided database
Dim x as integer
Do while X>0
Dim Y as double
Do while y>0
Dim z as double
IIF me.txtformvalue="yes", z=me.txtFieldValue, Null
IIF me.txtanswer=True, me.txtCalcNo=z, Null
Would you please adjust the above listed code, test it and provide alternative codes by using form fields and database connection for future references