开发者

How can I open a query in datasheet mode in a subform?

开发者 https://www.devze.com 2023-03-18 09:14 出处:网络
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\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消