Advertisement

12.17.2006 at 08:17AM PST, ID: 22095946
[x]
Attachment Details

How to filter datasheet, make it display records based on drop down selection.

Asked by JA67 in Microsoft Access Database

Tags: , ,

So far in my experience with MS Access I have only used unbound controls and now I am trying to make use of a subform in datasheet view, which is bound to columns in a table, and I am confused about how this is supposed to work.

I see that as soon as I type values into the datasheet they are immediately saved in the table, and I don’t have to write code to save it. That’s fine and it is working. But I don’t understand how, e.g. when I open the main form, to make the subform datasheet display only the records that are related to the main form. My datasheet simply displays everything in the table that it is tied to. I assume that I need to apply a filter to the datasheet and I have tried to do that but it’s not working. The F1 help for Filter is:

Me.Filter = "Country = 'USA'"
Me.FilterOn = True

I have tried to modify this to fit my needs but it’s not working.

I need to have the subform datasheet only display records where the CaseNumber (a field in the table) = txtCaseNumber (field on my main form). The way my database application works is that you select from a drop down list what Case you want to open. Say you select Case “ABC”; the app pulls all data related to Case ABC into the appropriate unbound controls on the main form by use of recordsets. But now I am trying to incorporate this bound subform into the main form and I want only those records that contain the selected case number to show up.

The table that my subform is bound to looks like this:

UniqueID  SUSPECT  CASENUMBER  VICTIM
1             Me           abc                  You  

Can you please explain to me how I should go about achieving the desired result?

Thank you very much!
JA67
Start Free Trial
[+][-]12.17.2006 at 08:33AM PST, ID: 18154842

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Access Database
Tags: datasheet, access, filter
Sign Up Now!
Solution Provided By: dannywareham
Participating Experts: 2
Solution Grade: A
 
 
[+][-]12.17.2006 at 08:35AM PST, ID: 18154851

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.17.2006 at 08:41AM PST, ID: 18154877

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.17.2006 at 08:44AM PST, ID: 18154886

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.17.2006 at 08:49AM PST, ID: 18154898

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.17.2006 at 08:50AM PST, ID: 18154902

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.17.2006 at 08:53AM PST, ID: 18154909

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.17.2006 at 09:46AM PST, ID: 18155037

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32