Solved

Query on load cmd

Posted on 2009-04-13
9
197 Views
Last Modified: 2013-11-28
Can I have the filter by form button run as soon as query opens?
0
Comment
Question by:-Gil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 480 total points
ID: 24131095
Try this in the load or open event:

docmd.RunCommand acCmdFilterByForm
0
 

Author Comment

by:-Gil
ID: 24131111
Where do I put this in a query I dont see a load or open event.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24131570
One of the reasons why queries are used, is for filtering.

So you could also add whatever you are trying to filter for as the Criteria.

(Or am I missing something)?

JeffCoachman
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:-Gil
ID: 24131928
I would like the query to open and appear like the screen shot below.
 It will not be used in a form or report.

On load I would like it to open with the FILTER BY FORM button pressed.

Like mbizup posted above with the docmd.RunCommand acCmdFilterByForm.
I see how that works for a form or report but I would like the query to start like that.

-gil


QuerypicEE.bmp
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 20 total points
ID: 24132285
(No Points wanted)


Open the query from a button on a form.

The code on the button will be something like this:

  DoCmd.OpenQuery "YourQuery"
  DoCmd.RunCommand acCmdFilterByForm

Again, no points wanted.

;-)

Jeff
0
 

Author Comment

by:-Gil
ID: 24132406
Curious.
Why wouldn't you want the points?
-gil

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24132907
Gil,

"Why wouldn't you want the points?"

1. Because the solution is mbizup's, not mine.
2. I don't really care about the points.
4. You have given me enough points!  ;-)  LOL!
3. I did this just to help out

So give the full points to mbizup

;-)

Jeff
0
 
LVL 61

Expert Comment

by:mbizup
ID: 24133238
Jeff,

Thanks.

-Gil
Sorry for being absent on this one.  I've been swamped today.  When I posted, I had misread "as soon as query opens" as  "as soon as Form opens".  

I'd be happy with any point allocation you decide on.  I have a lot of points and still can't trade them in for a steak dinner.  :)
0
 

Author Comment

by:-Gil
ID: 24137191
4. You have given me enough points!  ;-)  LOL!

So so true lol

Still gave you 20 to highlight the post
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question