Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

Error while Changing Form.Filter in VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 11 Dec 2007 02:25 GMT
Hi.  I have a combobox OnChange event which should update a form's datasource
base on the combobox's value in Colum1.  Code is below.  But when this code
executes I get the error "Run-time error '2001': You canceled the previous
operation."

Private Sub FilteredContacts_Change()
   Me.Form.Filter = "[Contact_ID] = '" & FilteredContacts.Column(1) & "'"
   Me.Form.FilterOn = True
End Sub

What am I doing wrong or how do I fix this?

Thanks!
Douglas J. Steele - 11 Dec 2007 11:42 GMT
That very misleading error message often occurs when you've misspelled the
name of a field in your statement.

Are you sure that the name of the field in the form's underlying recordset
is Contact_ID and not, say, ContactID or Contact ID?

Are you sure that it's a text field, and not a numeric field?

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Hi.  I have a combobox OnChange event which should update a form's
> datasource
[quoted text clipped - 11 lines]
>
> Thanks!
 
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.