Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-18-2009, 03:33 PM   #1
boomslanger
Registered User
 
Join Date: Jun 2009
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
boomslanger is on a distinguished road
Simple Filter or Query Solution Request

This is a very simple request but I have not been able to find a way to do it. I'm coming back to Access after not having touched it since 97.

We sell and maintain several types of high end electronic systems. I have created a main form for all our company assets under management and several supporting objects which is all working well. What I need to do is bring up a filtered assets datasheet form filtered on the value in a field.

For example:

If the current value in the Asset field is Baringa and then the user clicks on the List Assets control the resulting datasheet form should only list the Baringa assets. If the user then moves to another record and the asset is now Hydra then clicks on the List Assets control only Hydra records should show up in the datasheet form.

The other options selectable by the user are List by Category, List by Configuration, List by Project, List by OEM and List by Customer.

In each case whatever the value in the corresponding field, Category, Configuration, Project, OEM or Customer should be the criteria for what comes up in the datasheet. I don't need multiple or complicated criteria, just the datasheet form filtered on what's currently in the field corresponding to control.

The queries I've attempted haven't worked and then I thought that this would be more easily achieved by Filter, but don't know how to go about it. Any help would be appreciated.

boomslanger is offline   Reply With Quote
Old 06-18-2009, 04:19 PM   #2
CameronM
Registered User
 
Join Date: Jan 2009
Location: Brisbane, Australia
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
CameronM is on a distinguished road
Re: Simple Filter or Query Solution Request

When you open the datasheet form, use the WHERE clause to filter the results.

For example, if the user has the form open where the Asset field is called txtAsset and they press the button labelled List Assets, called cmdListAssets the following code would open the datasheet form called frmProductsList

Code:
Private Sub cmdListAssets_Click()
    DoCmd.OpenForm "frmProductsList", acFormDS, , "AssetName='" & Me.txtAsset & "'"
End Sub
You may need to tweak this a little if your Asset field is a combobox, but this may point you in the right direction.
__________________
Cameron Moses | EziData Solutions

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

(If someone has helped you, please add to their reputation by clicking on the icon that looks like the scales on the top right of their post)
CameronM is offline   Reply With Quote
Old 06-18-2009, 04:26 PM   #3
boomslanger
Registered User
 
Join Date: Jun 2009
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
boomslanger is on a distinguished road
Re: Simple Filter or Query Solution Request

Thanks heaps, I think that is what I want. I looked at the Where clause but was uncertain as to how to implement it.

Category, which is one of the user selections, is a combobox but I think I have enough to work it out now.

Regards.

boomslanger is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with make-table query - Should be quite a simple solution ravness Queries 18 10-29-2008 12:28 PM
Save Filter as a Query dgaller Modules & VBA 1 10-09-2008 10:55 AM
Form of Check Boxes to Filter a Query...HELP maytime Forms 6 09-11-2008 10:42 AM
cannot recreate a query after deleting it in vba ciqala Modules & VBA 2 08-25-2005 05:11 AM
[SOLVED] Annoying Query, yet simple? - Please Help. manowar Queries 4 07-29-2005 06:39 AM




All times are GMT -8. The time now is 03:07 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World