The best way is to create a DataSheet form Queries and Tables are not the best place for user interaction. Set the Record Source = to the Query/SQL Statement. Or you could set the Forms RecordSet property = to the Select statment opened as a RecordSet (ADO).
But if you must then create a temporary QueryDef and use Docmd.OpenQuery