Sabtu, 04 Mei 2013

RE: [MS_AccessPros] Filter for records with attachments

 

Kumar-

If Not IsNull(Me.cboSearchAttachments) Then
If Me.cboSearchAttachments = "Has attachment" Then
strWhere = strWhere & "([Attachment].[FileName] Is Not Null) AND
"
Else
strWhere = strWhere & "([Attachment].[FileName] Is Null) AND "
End If
End If

Your combo box should have two rows, one that asks for with attachments, and
the other that asks for without. You can decide the exact values and fix
the comparison above accordingly.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of access_kri
Sent: Saturday, May 04, 2013 2:53 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Filter for records with attachments

Thanks John, but can you help me with exact coding. To filter for other
fields, I am using the following codes.

If Not IsNull(Me.cboSearchPlant) Then
strWhere = strWhere & "([Plant] Like """ & Me.[cboSearchPlant] &
""") AND "
End If

If Not IsNull(Me.CboSearchTrade) Then
strWhere = strWhere & "([Trade] Like """ & Me.[CboSearchTrade] &
""") AND "
End If

etc.

Kind Regards,
Kumar

--- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@...>
wrote:
>
> Actually, you can do some filtering on the FileName - for example,
> LIKE "*.pdf" to find all records that have PDF attachments.
>
> Note also that when you include FileName in the query, you'll get one
> record for each attachment in a record. For example, a record that
> has three attachments will generate three rows in the recordset.
>
> John Viescas, Author
> Microsoft Access 2010 Inside Out
> Microsoft Access 2007 Inside Out
> Microsoft Access 2003 Inside Out
> Building Microsoft Access Applications SQL Queries for Mere Mortals
> http://www.viescas.com/ (Paris, France)
>
>
>
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John
> Viescas
> Sent: Saturday, May 04, 2013 9:51 AM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: RE: [MS_AccessPros] Filter for records with attachments
>
> Kumar-
>
> You cannot filter Attachments directly. To find out if a record
> *does* have an attachment, test for:
>
> [Attachments].[FileName] Is Not Null
>
> Conversely, to test to see if a record does not have any attachment,
> test for IS NULL.
>
> John Viescas, Author
> Microsoft Access 2010 Inside Out
> Microsoft Access 2007 Inside Out
> Microsoft Access 2003 Inside Out
> Building Microsoft Access Applications SQL Queries for Mere Mortals
> http://www.viescas.com/ (Paris, France)
>
>
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of access_kri
> Sent: Friday, May 03, 2013 8:15 PM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] Filter for records with attachments
>
> Dear All,
> I am having a continuous form where I display Attachments using
> attachment control. I use various unbound comboboxes to search for the
> records meeting the specified criteria. I want to filter for records
having
> attachements. Please help me with proper VBA coding to accomplish this. My
> unbound combobox is named cboSearchAttachments and Attachment field is
named
> Attachments.
>
> Also, when I right click on the attachments field of form, it does
not
> have filter option.
>
> Thanks and Regards,
> Kumar Iyer
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>

------------------------------------

Yahoo! Groups Links

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)
Recent Activity:
MARKETPLACE


.

__,_._,___

Tidak ada komentar:

Posting Komentar