Subform Filter (1 Viewer)

Beany

Registered User.
Local time
Today, 15:26
Joined
Nov 12, 2006
Messages
155
Hi,

Ive attached my database:

I have a main form called 'AssetMain'...

My table 'Asset' contains the important information...

In AssetMain i have a combobox (user). My intention is to click on a username and filter the details from table 'Asset' to the subform in the form 'Form1'. Can someone have a look at this?

And also can subform fields have dropdown lists?

thanks
 

Attachments

  • Access Control.zip
    23.7 KB · Views: 78

MStef

Registered User.
Local time
Today, 15:26
Joined
Oct 28, 2004
Messages
2,251
1) You don't need a MainForm for this.
2) Open a subform as single, and use FILTER BY FORM icon.
 

Beany

Registered User.
Local time
Today, 15:26
Joined
Nov 12, 2006
Messages
155
you're correct....but i would prefer to have a main form.

Can i not use something similar to filter by form on the Main Form?
 
Last edited:

Zigzag

Registered User.
Local time
Today, 15:26
Joined
Aug 19, 2007
Messages
386
Change Form1 Data source

Hi,

I have changed it to filter by "User" only but if you have a look you will get the idea.
 

Attachments

  • Access Control.zip
    29.1 KB · Views: 79

Beany

Registered User.
Local time
Today, 15:26
Joined
Nov 12, 2006
Messages
155
Thank you Zigzag...

I can see that youve included an open button in ASSETMAIN form...which is good but is it possible to choose a user and it automatically opens Form1 (contains subform)???

cheers
 

Zigzag

Registered User.
Local time
Today, 15:26
Joined
Aug 19, 2007
Messages
386
Yep... Thats not a problem, take the code from the button and place it in the "on Change" event of the Combo Box. However that would then restrict you to only being able to filter "users". If you placed the subform on the main form you could get the "On change" event to requery the subform.
 

Beany

Registered User.
Local time
Today, 15:26
Joined
Nov 12, 2006
Messages
155
Excellent i copied the button code and placed it in the On Change event for the combobox, and it works...

I didnt really understand what you meant by:

"However that would then restrict you to only being able to filter "users". If you placed the subform on the main form you could get the "On change" event to requery the subform. "

requery? what does this do? and how do i requery it?

thanks mate
 

Zigzag

Registered User.
Local time
Today, 15:26
Joined
Aug 19, 2007
Messages
386
Filter Subform

After you have selected a User , Form1 will open before you have a chance to select Department or Site.
Have a look at the attachment, it has the subform on the main form.
 

Attachments

  • Access Control.zip
    34.1 KB · Views: 75

Beany

Registered User.
Local time
Today, 15:26
Joined
Nov 12, 2006
Messages
155
Right...

Ive had a look at the attachment and i understand what you mean.. but i prefer it the other way.... this is because on the main page i have three different ways of searching for info... user, department and site... does that make sense??!!!

On form1 (includes subform) can i add a field that counts and displays how many records each user has?
 

Beany

Registered User.
Local time
Today, 15:26
Joined
Nov 12, 2006
Messages
155
anyone?

Any Help would be appreciated

Thanks
 

Zigzag

Registered User.
Local time
Today, 15:26
Joined
Aug 19, 2007
Messages
386
Sorry Beany,

I'm caught up with a few things at the moment, if you still need help in a couple of days I will get back to you.
But I'm sure someone will pick this up and help you by then.
 

boblarson

Smeghead
Local time
Today, 07:26
Joined
Jan 12, 2001
Messages
32,059
Hi,

Ive attached my database:

I have a main form called 'AssetMain'...

My table 'Asset' contains the important information...

In AssetMain i have a combobox (user). My intention is to click on a username and filter the details from table 'Asset' to the subform in the form 'Form1'. Can someone have a look at this?

And also can subform fields have dropdown lists?

thanks

Find attached a working copy of what I think you wanted. It will filter by one OR ALL of the combo boxes. Right now you don't have enough data where filtering by all will generate anything but it does do it.
 

Attachments

  • Access Control_rev08-29-2007.zip
    37.2 KB · Views: 98

Beany

Registered User.
Local time
Today, 15:26
Joined
Nov 12, 2006
Messages
155
Boblarson, thank you very much..


It looks so much better....

If i wanted to add a report button for each user, department or site (location), how would you advise me to approach this?

What i want is for a report button to appear for my selections and i can print a report just for that selection?

any ideas?

once again, thank you so far
 

Users who are viewing this thread

Top Bottom