Hi,
In VBA code, How can i run Sql query..? I need to delete a record by the below query...
Docmd.runsql(Delete * from Payment_detail_Table where Payment_id=(Select Max(Payment_id) from Payment_Table)
Is it correct..? I tried, but its not working.
-------------
How can i run Sql query from MACRO..?
I put below code in Sql statement coloumn where it shows the below error...
Code:
Delete * from Payment_detail_Table where [Payment_id]=(Select Max([Payment_id]) from Payment_Table)
Error
Missing ),], or Item in query expression '[Payment_id]=(Select Max([Payment_id]) from Payment_Table.
Here, My accomplishment is to delete a record in both table..
Any suggestion would be greatly appreciated if you suggest in both VBA Code & MACRO code..
Thanks in advance..
ngr.