Hi I need help to resolve a problem. I need to write in a field of the latest record added, the value of count (num. of records referred to the same company in table).
Here I copied code applied in AfterAdded Table Events, but it doesn't work.
Could you suggest why?
Thank you
dim ax
Sub AfterAdd()
'** Insert a record into another table ****
strSQLInsert = "SELECT Count(*) AS Espr1 FROM [PRO] WHERE ((([PRO].Azienda)="Company"));"
dbConnection.Execute strSQLInsert
strSQLInsert = "SELECT LAST(IDproIN) AS [highest] from [PRO];"
dbConnection.Execute strSQLInsert
ax=Espr1
strSQLInsert = "UPDATE [PRO] set IDProIN = ax;"
dbConnection.Execute strSQLInsert
End Sub