• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Query on load cmd

Can I have the filter by form button run as soon as query opens?
0
-Gil
Asked:
-Gil
  • 4
  • 3
  • 2
2 Solutions
 
mbizupCommented:
Try this in the load or open event:

docmd.RunCommand acCmdFilterByForm
0
 
-GilAuthor Commented:
Where do I put this in a query I dont see a load or open event.
0
 
Jeffrey CoachmanCommented:
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
-GilAuthor Commented:
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
 
Jeffrey CoachmanCommented:
(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
 
-GilAuthor Commented:
Curious.
Why wouldn't you want the points?
-gil

0
 
Jeffrey CoachmanCommented:
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
 
mbizupCommented:
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
 
-GilAuthor Commented:
4. You have given me enough points!  ;-)  LOL!

So so true lol

Still gave you 20 to highlight the post
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now