Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSAccess 2000: Updating Multiple Fields in a Non-Relative Format

Status
Not open for further replies.

sck501

Technical User
Jul 31, 2001
5
US
I'm putting together a 'quick and dirty' scoring program and am having difficulty with using the update query.

Presently, I have two update queries. The first is intended to compare the examinees' answers to the answer string. Each answer has its own field. If the fields do not match, the field is updated to 0. The second query does the same type of process but updates the field to 1 if the answers match.

I was hoping to only have the two queries, one to mark correct answers and one to mark incorrect answers. The problem is that nothing will update unless the examinee got all the answers correct or incorrect--since the query is applying the criteria to the whole record, instead of solely to the field I wish score.

Is there anyway I can specify that the criteria listed below the field should be applied only to that field? So the field for answer 1 will be updated as correct, regardless of whether the criteria for answer 2's field matches?

I know I can make up a correct update query and an incorrect update query for each answer, but I'd rather that be a last resort, since there are 80 questions.
 
I think that if you put the criteria in the "Update to" field in the grid, you can do the whole job in one query. Something like: Iif([Answer1]=[ExamineeAnswer1], 1,0) in the [Result1] field's "Update to" box, and similar formulas in the remaining [ResultN] fields.

You could use the Expression Builder for the first one, then copy-paste-tweak for the rest.

Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top