Solved

Query on load cmd

Posted on 2009-04-13
9
196 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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

776 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