Hello ,
I have inventory management application , I have problem as follows :
- I have 2 tables :
( Master Table : Inventory / Include fields : StoreID - StoreName )
( Details Table : Items / Include fields : ItemID - StoreID - ItemName - ItemsData )
- Link Field is : StoreID
- I want to add event in ( list page ) for Master Table ( Inventory ) in ( BeforeDelete ) event to check if there is child records
in details table ( Items ) linked to the parent record that will be deleted.
- I use several event codes to achieve the above required event but without success.
- As example for code I use the following :
'** Check if specific record exists ****
strSQLExists = "select * from Items where StoreID'" & keys("StoreID") & "'"
set rsExists = CreateObject("ADODB.Recordset")
rsExists.Open strSQLExists, dbConnection
if not rsExists.eof then
BeforeDelete=false
message = "Can't Delete - This Record Have Child Records "
else
BeforeDelete=true
end if
rsExists.Close : set rsExists = Nothing
'** Code End -- Check if specific record exists ****
Please advise ,
Thanks