Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Split Form with Criteria for Query Results

Posted on 2010-11-14
5
Medium Priority
?
756 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

618 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