firas shaar

firas shaar

  • NA
  • 15
  • 17k

condition for add new row

Sep 13 2014 11:13 AM
hi
I have two table the first is called Imprrests and the second is called IprestsPays
Imprest_ID column is primary key in Imprests table and foregin key in ImprestsPays table

Imprests table consists the following columns (Imprest_ID,Impres_value,Imprest_date, Employee_ID)
Employee_ID column is primary key in Employees table and foregin key in Imprests table

ImprestsPays table consists the following columns (ID,Payment_value,Payment_date,Imprest_ID)

my problem is when buttonadd_click event in Imprsts form
 I want to prevent user from insert any new imprest for employee in Imprests table if employee haven't paid all payments in
ImprestsPays table for old imprest

How can I solve this problem?
What is the code to do that?