Default Value in Table based on IF Statement

joeserrone

The cat of the cul-de-sac
Local time
Yesterday, 21:45
Joined
Dec 17, 2006
Messages
164
I have a database where I uploading data in from a secondary source. I wanted to be able to assign to the field name in my Table called "TimeWorked" as default a value of 0 if the amount in the Table Field called "Dollar Amount" is < or = to 200

I added the following expression in the Default Value of my "TimeWorked" field"

IIF([Dollar Amount]<=200,0,1)

However when I save the table its telling me that the database engine does not recognize the field "Dollar Amount"

Any ideas how I can accomplish this?

Thanks!
 
I have a database where I uploading data in from a secondary source. I wanted to be able to assign to the field name in my Table called "TimeWorked" as default a value of 0 if the amount in the Table Field called "Dollar Amount" is < or = to 200

I added the following expression in the Default Value of my "TimeWorked" field"

IIF([Dollar Amount]<=200,0,1)

However when I save the table its telling me that the database engine does not recognize the field "Dollar Amount"

Any ideas how I can accomplish this?

Thanks!

As far as I know, you can not set a default value to depend on another fields value. At the time when the default values are set, the other fields will not have a value yet.


You will need handle this in your import process. For example: you could run an update query to set the value once the records after the records are importsed.
 

Users who are viewing this thread

Back
Top Bottom