I have a transaction table, There are 2 fields FuelLiters & FuelAmount. Both should be >0 or =0.
If by mistaken FuelLiters entered as 0 and FuelAmount >0, computer should prompt about this mistake.
Software/Hardware used:
ASKED:
June 9, 2010 7:39 AM
UPDATED:
June 20, 2010 9:36 PM
I have a transaction table, There are 2 fields FuelLiters & FuelAmount. Both should be >0 or =0.
If by mistaken FuelLiters entered as 0 and FuelAmount >0, computer should prompt about this mistake.
I have a transaction table, There are 2 fields FuelLiters & FuelAmount. Both should be >0 or =0.
If by mistaken FuelLiters entered as 0 and FuelAmount >0, system should prompt about this mistake.
I am using MS Access-2000
Thanks
You can use the table constraint:
([FuelAmount]=0 and [FuelLiters]=0) Or ([FuelAmount]>0 And [FuelLiters]>0)
Thanks for your reply. But Sorry! i couldnt understand “table constraint” where this statement put., please reply
I’m not sure if this will work on Access 2000.
You could create a Visual Basic module withsome code like this:
> But Sorry! i couldnt understand “table constraint” where this statement put., please reply
Type it in the Validation Rule field of the table property
As Carlosdl said… u can either handle it at the application end before record gets inserted into the transactions table or u can use a database check constraint on the field to handle it.
You can also u a database TRIGGER to handle that on the event of an “INSERT” into the transactions table. ….(ie if ur database supports triggers).