473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to apply filter in Macros in Microsoft Access 2007?

1
Good day
I'm Trying to apply filter in Macros in Microsoft Access 2007 but I failed in typing (where condition) in Macros.

I want to create a split form with a search text box above actually like a drop down list when I select a specific person in the text box a list of his clients will appear in the subform.. I tried to do that with (apply filter - Macros) but I failed

can you help me with this ??
May 13 '15 #1
2 4721
Shem K
40
Hello ka2015.
I'm not the best person to answer this, but I'll give you a method that worked for me.

I bear in mind that:
a. on the main form, you have the field you require as a source field for your filter (in this case, person's ID, person's name, or person's initials field(s), depending on what applies for you).
b. you have the target query (in this case, the clients table or query)
c. on the clients query, there is a field for details of the filter (i.e. the person in 1. above).

Having fulfilled a., b., and c., above:

1. Open your main form in design view. Ensure you have the required fields (as in a. above)
2. From the navigation pane, select your target query (the clients query) and drag it to the main form.
The sub-form wizard dialog opens, asking you to define which fields on your form link to your sub-form, or to choose the provided list
Select the option Define my own. In the drop down given, select the fields on your form which you want to link on your sub-form (i.e. if, Main Form field is Initials, Sub-form field must be Initials - fields having similar data types and data entries).
3. Click Next. Name your sub-form, then Finish.
Save your form.

In the Form view, you will notice that the person on the main form has their respective clients in the sub-form.

To create the drop-down control,
4. Return to Design View
5. On the Design tab, select option Combo Box
6. Draw the combo box on a blank space in your main form.
7. The combo box wizard dialog opens
8. Select the lowest option: "Find a record in my form based on the value I selected in my combo box".
9. Click Next. Choose the Field (e.g. ID or Initials or Person's Name, as in a. and step 2. above)
10. Click Next, up to the last screen for naming your combo box. Click Finish.
You have just completed your look-up form! :)

In the form view, you can use the combo box to select from the list which person on the main form you would like to view.
Below, in the sub-form, the respective person's list of clients is displayed, based on your selection.

All the best, as you accomplish this!
May 13 '15 #2
zmbd
5,501 Expert Mod 4TB
KA2015
These are much more easily accomplished using VBA.
Unless you are planning to publish to SharePoint or WebApp you should consider moving away from ACC-Macro development and instead turn to VBA.Access / VBA Insights Sitemap [/url]
You will find several links in our Access-Insights section covering several filtering methods:
-filtering-
Another problem is the use of the "Split Form"
These forms are extremely problematic in the long run.
If you are actually using the "split form," and not the parent-child-form as Shem-K appears to have constructed, then your control should be in the header and you will need to do some coding to apply the filters to the form's filter property.

I'm on my way out the door for the day; however, I'll try to look into the macro side of this tomorrow.

-z
May 13 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: lineah | last post by:
How can J use animated icons or play avi file in microsoft access 12
4
by: Iyhamid | last post by:
Hi I am looking for codes to filter and apply filter to my data base using access
0
by: =?Utf-8?B?QW15?= | last post by:
I'm currently using Microsoft Office 2007 which includes Access. I have set up a secondary language in my computer since this is required, however I have set the default input language as English...
4
by: jackbenimble999 | last post by:
Hello! Has anyone had trouble running macros on the Access runtime version on Vista? I tried enabling macros in the trust center, and thought for sure this would solve the problem! But, alas, my...
1
by: fifothekid | last post by:
Hi everybody, I made a primitive cost control database system using Microsoft Access 2007 as a front-end (don't ask my why did I use Microsoft Access!!!) and SQL Server 2005 Enterprise as a back-end...
8
by: Jesse Jones | last post by:
I am using Access 2007 and I am a complete ignoramus with this stuff. I have designed a modal login form for my database that is working perfectly. I did this by placing an invisible dlookup...
5
by: jbrown8253 | last post by:
Microsoft Access 2007 Export Report for each record within a recordset I am attempting to click a button on a form that will export a report that is unique to each record. I created a query that...
1
by: bsdesai | last post by:
I have created a report using Access 2007 that has 4 fields: LineNumber, Butterfat, SkimMilk, Description. The report is sorted by line numbers which always begin with 1 and end at number 26. ...
4
by: Fairoose | last post by:
Hi, Oracle ODBC driver is not able load all the oracle tables in MS access 2007. We are not able to view some of the tables. we have provided all access from oracle side. Please let us know if...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.