taxdw
01-17-2007, 09:59 AM
I have mulitple tables that hold data for a full assessment. Each table holds a different section. Each table has a separate form that is completed. On these forms are questions with checkboxes. If the checkbox is entered a value of Yes is accepted. If the checkbox is no then I need to set a value in a field. I tried 2 different solutions:
1) I tryied to create a update query that would look at the field and if the value is = no then update the field. This will work if I create separate queries for each of the fields I need entered. The only problem was that I have about 30 fields that need to be updated with different information. I would then have to create a macro that would run this query when the page was closed. I attempted to entered multiple fields that have the same criteria, value = no, but have different fields that will get input into. The only problem is that it updates all even if one value is yes. What am I missing? Is there a way to run query that will update different fields? Is there a way to write a generic query that asks for the fields and input the data based on that field.
2) My second attempt was to write an if then statement on the form page that looked at the value of the field and if no, enters the text in the correct field. When I did this nothing was shown. Here is the code I wrote.
=IIf([mealPrep]=No,[mealNeeds]="Nutritional Services","")
Is there an easier way to gather this data?
1) I tryied to create a update query that would look at the field and if the value is = no then update the field. This will work if I create separate queries for each of the fields I need entered. The only problem was that I have about 30 fields that need to be updated with different information. I would then have to create a macro that would run this query when the page was closed. I attempted to entered multiple fields that have the same criteria, value = no, but have different fields that will get input into. The only problem is that it updates all even if one value is yes. What am I missing? Is there a way to run query that will update different fields? Is there a way to write a generic query that asks for the fields and input the data based on that field.
2) My second attempt was to write an if then statement on the form page that looked at the value of the field and if no, enters the text in the correct field. When I did this nothing was shown. Here is the code I wrote.
=IIf([mealPrep]=No,[mealNeeds]="Nutritional Services","")
Is there an easier way to gather this data?