This topic is locked

Master / Detials - Check if specific record exists in Details

10/4/2011 9:22:37 PM
ASPRunnerPro General questions
T
TechArt author

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

Sergey Kornilov admin 10/5/2011

I recommend post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program. Someone will help you with this.