Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Executing a hidden query

10 views
Skip to first unread message

Phil Hibbs

unread,
Jul 24, 2014, 6:33:57 AM7/24/14
to
I've got a form, and when I click a button it opens a query, but I don't want that query to be visible to the user. I just want the VBA to exectue the query and fetch some values into unbound controls on the form. Any suggestions how I can do that?

Phil Hibbs.

John W. Vinson

unread,
Jul 24, 2014, 5:38:51 PM7/24/14
to
On Thu, 24 Jul 2014 03:33:57 -0700 (PDT), Phil Hibbs <sna...@gmail.com> wrote:

>I've got a form, and when I click a button it opens a query, but I don't want that query to be visible to the user. I just want the VBA to exectue the query and fetch some values into unbound controls on the form. Any suggestions how I can do that?
>
>Phil Hibbs.

Don't open the query at all. Instead use =DLookUp("[fieldname]",
"[queryname]", "optional criteria") as the Control Source of the textbox. You
can of course just use DLookUp directly on the table using the same criteria
as you use in the query, and not bother creating the query at all.

Note that this forum is no longer supported by Microsoft; Usenet newsgroups
are like "the living dead". But there are only a couple of us old timers who
still check the group at all. See my .sig for better, more active forums for
support.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:

http://answers.microsoft.com/en-us/office/forum/access?tab=question&status=all
http://social.msdn.microsoft.com/Forums/office/en-US/home?forum=accessdev
and see also http://www.utteraccess.com
0 new messages