Dale Kalsow
dkalsow at yahoo.com
Wed Aug 19 11:44:34 CDT 2009
that worked - thanks! --- On Wed, 8/19/09, Dan Waters <dwaters at usinternet.com> wrote: From: Dan Waters <dwaters at usinternet.com> Subject: Re: [AccessD] Filtering a screen To: "'Access Developers discussion and problem solving'" <accessd at databaseadvisors.com> Date: Wednesday, August 19, 2009, 10:59 AM Try using Replace like this, X = Replace(Me.cboCustomerHead.Column(0),"'", "''") This replaces one apostrophe with two, which will hopefully prevent the error. Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dale Kalsow Sent: Wednesday, August 19, 2009 10:50 AM To: Access Developers discussion and problem solving Subject: [AccessD] Filtering a screen Good Morning, I am filtering the records on the screen with the following code: If Me.cboCustomerHead.Column(0) = "" Then Me.FilterOn = False Else Me.Filter = "tblCustomerToOwner.Customer = '" & Me.cboCustomerHead.Column(0) & "'" Me.FilterOn = True End If This works great but sometimes the item in the cboCustomerHead has a single quote in which then causes an erorr. Does anyone know how I can filter using an item with a single quote? Thanks! Dale -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com