adding values automatically

bursteffect

New member
Local time
Yesterday, 23:02
Joined
Mar 5, 2013
Messages
7
Hello everyone. I hope your holiday went well. I have a very easy question regarding if statements, when I say easy that means not for me but for you.
here the problem. I have a table name main table , which consist of 4 fields.
1.date 2.driver 3.violation 4.violation_number. Now what I want to do is, whenever I place a word like "absent" into the violations field I would like the violation_number field to automatic show the number 5.
here is my statement...........if me.violations.value = "absent" then me.violation_number.value = 5 end if.

I even tried if me.violations.text = "absent" then me.violaltion_number.value = 5
I need help please.
 
You shouldn't be adding data directly to tables, you should be using a form. You can then put some code on the violation input that updates the violation_number field to achieve what you want.
 
Im not adding to a table. I have a form and a query also. Im just trying to find out how to store a value in a field automatically by using a iff statement
 
A query really doesn't factor into this.

Also, nothing is "automatic"--an action has to be taken to trigger the result. My first post identified how you should accomplish this.
 

Users who are viewing this thread

Back
Top Bottom