I have a subform on a mainform. I want to have it open a query in datasheet view. I tried:
Me.subform.Application.DoCmd.OpenQuery "xxx"
But it just opens the query in the background, not inside the subform.
I know that by creatin开发者_StackOverflow中文版g a form bounded to this query, then I can change de subform's SourceObject to open it inside the subform. However I have here many different queries, I just want to find a simpler way.
EDIT: Maybe something like: Me.subform.OpenQuery "xxx"
, but I didn't find it.
Set the sub form's Source Object to a query name instead of a form name. In the property sheet, it should look like Query.XXX.
精彩评论