Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft Access
Microsoft Access Form Coding
Cancelled Previous Operation
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Guest, post: 9138662"] Hi All, I am running the following code and getting the "You Cancelled the previous operation" error message. When I first open the form the error shows up on the "Me.Filter = Left(strFilter, Len(strFilter) - Len(cAND))" line but then on subsequent attempts it shows up on the "Me.FilterOn = True" line. On the Main form "cbo_cnt_spec" and on the subform "Cnt_spec" are both Lookup fields where I am trying to match the second colum. The same applies to the Main form "cbo_actn" and the subform "Action" fields. The first colum is the number field, and the second column contains the text. Can I even do that? Here is some additional information: Numeric fields on the main form are: cbo_Acct_Num cbo_Terr and on the Subform the numeric fields are: Account_No Terr Private Function BuildFilter() Const cAND As String = " AND " Dim strFilter As String If Not IsNull(cbo_Cnt_Spec) Then strFilter = strFilter & "[Cnt_Spec]='" & [cbo_Cnt_Spec].Column(1) & "'" & cAND End If If Not IsNull(cbo_Terr) Then strFilter = strFilter & "[Terr]=" & [cbo_Terr] & cAND End If If Not IsNull(cbo_account_No) Then strFilter = strFilter & "[Acct_Num]=" & [cbo_account_No] & cAND End If If Not IsNull(cbo_Acct_Name) Then strFilter = strFilter & "[Acct_Name]='" & [cbo_Acct_Name] & "'" & cAND End If If Not IsNull(cbo_contract_No) Then strFilter = strFilter & "[Contract_No]='" & [cbo_contract_No] & "'" & cAND End If If Not IsNull(cbo_Month_Year) Then strFilter = strFilter & "[Month/Year]='" & [cbo_Month_Year] & "'" & cAND End If If Not IsNull(cbo_actn_No) Then strFilter = strFilter & "[Action]='" & [cbo_Action] & "'" & cAND End If If Len(strFilter) = 0 Then Me.FilterOn = False Else ' remove the last " AND " Me.Filter = Left(strFilter, Len(strFilter) - Len(cAND)) Me.FilterOn = True End If End Function [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Access
Microsoft Access Form Coding
Cancelled Previous Operation
Top