?
Solved

Split Form with Criteria for Query Results

Posted on 2010-11-14
5
Medium Priority
?
713 Views
Last Modified: 2012-05-10
I'm learning about forms and working on some real-life reasons to practice.  Can someone start me on the right track on this simple project:

I have a table with customer records.  I'd like to have a split form (or screen of some kind if it shouldn't be a split form) where the top portion has a text box for entering city.  And the bottom portion will display all the records from that city.

Any help in getting started is much appreciated.
0
Comment
Question by:BBlu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 800 total points
ID: 34130382
You don't want to use a Split form for that. A Split Form shows the same data in 2 different views (a Detail view and a Master view).

Instead, just add an unbound Textbox (txSearch) and Command Button (cmSearch) to the Form Header, then add code like this in the Click event of cmSearch:

Me.Filter = "YourCityField='" & Me.txSearch & "'"
Me.FilterOn = True

You can also "clear" the filter like this:

Me.FilterOn = False
0
 
LVL 19

Assisted Solution

by:Richard Daneke
Richard Daneke earned 400 total points
ID: 34130863
The sample Task managerment database shows a couple of form techniques worth learning.
As relates to your question, a Search box is placed on the form that permits saving filters as they are used on forms.  This technique will let your users create and extend the use of filters as needed without coding!
I have attached a saved example (Task management database1), but it is available free from the Microsoft Office web site.
Task-management-database1.accdb
0
 

Author Comment

by:BBlu
ID: 34131976
That worked LSM.  And I'm going to open and learn about form techniques with the Task Management Database.  Can someone tell me how to get the form to appear like a datasheet? I got the filter to work.  But I'd like the results to appear like a datasheet, instead of one by one.
0
 
LVL 85
ID: 34132376
You can set the View to be Datasheet, but if you do I believe you lose the ability to use the Headers and Footers. You can use a Mainform/Subform setup, but this will make things a bit more tricky.

You can set the View to Continuous, which you can build to look very much like a Datasheet, and you can then use the Headers and Footers as always.
0
 

Author Closing Comment

by:BBlu
ID: 34133843
Thank you both for your help.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Suggested Courses

801 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