I need to copy the tables orders and orderdetails containng only the last order.I am copying them to another database using the formula
DoCmd.CopyObject db.Name, "orders", acTable, "orders"
DoCmd.CopyObject db.Name, "orderdetails", acTable, "orderdetails"
I want to use the criteria (SELECT Max([orderid]) FROM orders) in order to send the tables with only the last order,but i do not know how to build the code.Can you help me ?
DoCmd.CopyObject db.Name, "orders", acTable, "orders"
DoCmd.CopyObject db.Name, "orderdetails", acTable, "orderdetails"
I want to use the criteria (SELECT Max([orderid]) FROM orders) in order to send the tables with only the last order,but i do not know how to build the code.Can you help me ?