Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2006

Tip: Looking for answers? Try searching our database.

Filter Data in a section (not a DDL) populated by Secondary Data Source

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
grizeen - 19 Mar 2006 21:43 GMT
I have a secondary datasource that I would like to filter by what is entered
in the main form.
The main form is a database for Meeting Information and the secondary form is
for safety incidents.
I would like the safety section to only show data for the date that is
queried in the main meeting form.

I set it up as the following:

1. Double-click the expression box
2. Click the function button beside the default value field
3. Click Insert Field or Group
4. Expand my secondary data source to the entry date
5. Click the Data Filter button on the bottom left of the Select a Field or
Group dialog box
6. Choose the Secondary Data sources entry date (Incident Date) field in the
first drop-down, equals in the second drop-down, and Select a Field or Group
from the third drop-down
7. In the dialog box that pops up, go back to my Main DOM and choose the
query date (MeetingReportedDate) from the main DOM.
8. Click OK about 8 times.

My Xpath is here:
xdXDocument:GetDOM("tblIncidentLineItem")/dfs:myFields/dfs:dataFields/d:
tblIncidentLineItem[@IncidentDate = xdXDocument:get-DOM()/dfs:myFields/dfs:
queryFields/q:ptblMeeting/@MeetingDateReported]

This particular field I am trying to filter is Incident Department and If i
can get the date filter to work here I will filter the other fields

But i can not get it to show data, even though there are matching dates. If i
don't filter, data populates - Any help would be greatly appreciated.
S.Y.M. Wong-A-Ton - 21 Mar 2006 20:11 GMT
Is the date format of @IncidentDate the same as that of @MeetingDateReported?
Or do they differ? If they differ, the filter probably won't work. Try
entering a date manually instead of the
"xdXDocument:get-DOM()/dfs:myFields/dfs:queryFields/q:ptblMeeting/@MeetingDateReported"
part when setting up the "Filter Data" and try to find out what date format
is expected.
---
S.Y.M. Wong-A-Ton

> I have a secondary datasource that I would like to filter by what is entered
> in the main form.
[quoted text clipped - 28 lines]
> But i can not get it to show data, even though there are matching dates. If i
> don't filter, data populates - Any help would be greatly appreciated.
grizeen - 22 Mar 2006 00:35 GMT
One is a date picker (Meeting Date Reported) and One is a Text box.  Both are
set to not display time.  Do date pickers carry the dat eexactly as shown on
screen?

>Is the date format of @IncidentDate the same as that of @MeetingDateReported?
>Or do they differ? If they differ, the filter probably won't work. Try
[quoted text clipped - 10 lines]
>> But i can not get it to show data, even though there are matching dates. If i
>> don't filter, data populates - Any help would be greatly appreciated.
S.Y.M. Wong-A-Ton - 22 Mar 2006 14:18 GMT
No, what you see on screen is not the actual value used by InfoPath. InfoPath
uses a format like YYYY-MM-DDTHH:NN:SS.
---
S.Y.M. Wong-A-Ton


> One is a date picker (Meeting Date Reported) and One is a Text box.  Both are
> set to not display time.  Do date pickers carry the dat eexactly as shown on
[quoted text clipped - 14 lines]
> >> But i can not get it to show data, even though there are matching dates. If i
> >> don't filter, data populates - Any help would be greatly appreciated.
grizeen - 22 Mar 2006 04:15 GMT
I think you may have hit on it - I am still not sure how to fix it though -
I got a record for the incident section if I set the filter to  "2006-03-
18T00:00:00".
I noticed the date picker does not put out time if you say show XML value.  I
am not sure i can make the two fields equal

>Is the date format of @IncidentDate the same as that of @MeetingDateReported?
>Or do they differ? If they differ, the filter probably won't work. Try
[quoted text clipped - 10 lines]
>> But i can not get it to show data, even though there are matching dates. If i
>> don't filter, data populates - Any help would be greatly appreciated.
S.Y.M. Wong-A-Ton - 22 Mar 2006 14:21 GMT
You could try to get their formats equal using the substring() and concat()
functions. I'm not sure if these functions will work in a filter, though. For
information on dates in InfoPath and ways on manipulating them, take a look
at the date/time solutions I've written on my website:
http://enterprise-solutions.swits.net/infopath/solutions.htm#datetime
---
S.Y.M. Wong-A-Ton

> I think you may have hit on it - I am still not sure how to fix it though -
> I got a record for the incident section if I set the filter to  "2006-03-
[quoted text clipped - 16 lines]
> >> But i can not get it to show data, even though there are matching dates. If i
> >> don't filter, data populates - Any help would be greatly appreciated.
grizeen - 22 Mar 2006 19:00 GMT
Thanks so much I got the concat to work and I can now filter the expression
boxes in the Incident Section that is supplied by the secondary data source -
the new problem is I get blank sections - looks like I am filtering the
expression boxes and not the sections (I tried conditional formating, but all
sections where hidden, not just the ones that did not have data)  Any ideas?

>You could try to get their formats equal using the substring() and concat()
>functions. I'm not sure if these functions will work in a filter, though. For
[quoted text clipped - 9 lines]
>> >> But i can not get it to show data, even though there are matching dates. If i
>> >> don't filter, data populates - Any help would be greatly appreciated.
S.Y.M. Wong-A-Ton - 23 Mar 2006 18:59 GMT
I'm not sure whether I understand your scenario well enough to know what
could be going wrong. If you are using a repeating section that is bound to
your main data source the "Filter Data" option should be available on the
repeating section and you could use the same filter you previously used.
---
S.Y.M. Wong-A-Ton

> Thanks so much I got the concat to work and I can now filter the expression
> boxes in the Incident Section that is supplied by the secondary data source -
[quoted text clipped - 15 lines]
> >> >> But i can not get it to show data, even though there are matching dates. If i
> >> >> don't filter, data populates - Any help would be greatly appreciated.
grizeen - 24 Mar 2006 01:41 GMT
The repeating section is bound to my secondary data source. Therefore I can't
filter it
The repeating section is made up of expression boxes.  

I tried mapping the repeating section to a field I created in main data
source so I could filter it, but it will not show repeating information from
the secondary source.

My overall goal with this is to show information from a second Access
Database - this data does not need to be modified so the secondary sourse is
a good choice - I just need to filter this repeating section to show data
from the secondary source that matches data retrieved from the main
>I'm not sure whether I understand your scenario well enough to know what
>could be going wrong. If you are using a repeating section that is bound to
[quoted text clipped - 8 lines]
>> >> >> But i can not get it to show data, even though there are matching dates. If i
>> >> >> don't filter, data populates - Any help would be greatly appreciated.
S.Y.M. Wong-A-Ton - 24 Mar 2006 15:24 GMT
Is coding an option?

I will mull it over the weekend, but I'm afraid that you will only be able
to get this done through code, dynamically adding a WHERE-clause to the
Command of the secondary data source using the queryField values.
---
S.Y.M. Wong-A-Ton

> The repeating section is bound to my secondary data source. Therefore I can't
> filter it
[quoted text clipped - 20 lines]
> >> >> >> But i can not get it to show data, even though there are matching dates. If i
> >> >> >> don't filter, data populates - Any help would be greatly appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.