473,394 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Runtime error 2001 - huge frustration

56
I've been using code similar to this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Option Compare Database
  3.  
  4. Private Sub Form_Open(Cancel As Integer)
  5.  
  6.     SetFilter
  7.  
  8. End Sub
  9.  
  10. Sub SetFilter()
  11.  
  12.     Dim LSQL  As String
  13.     Me.Refresh
  14.     LSQL = "SELECT * FROM AccountCardRegister, AccountCardComments"
  15.     LSQL = LSQL & " WHERE AccountCardRegister.AccountCard = '" & Combo128 & "'"
  16.  
  17.     Debug.Print LSQL
  18.     Form_Maintain_CardDetails.RecordSource = LSQL
  19.  
  20. End Sub
  21.  
  22.  
  23. Private Sub Combo128_AfterUpdate()
  24.  
  25.  
  26.     SetFilter
  27.  
  28. End Sub
  29.  
  30.  
throughout my DB. It works on all my forms apart from the one I have detailed above. I can't figure out why.

Basically, you select a record using the combo box and all the text boxes I have on the screen populate for that record, including a subform which is a single textbox. Its not getting past the initial openform though!

The status bar details "This recordset is not updatable" when I try to go into the form. No other form does this. Can anyone else?

The full error message is "You cancelled the previous operation".

I've stepped through a few times and its the WHERE clause that is causing the most grief. If I just select *, it all runs through fine, but this doesn't let me whittle down my records by using the combo box.

Thanks!
Apr 18 '07 #1
6 1798
Widge
56
Delete delete.... I've found it.

I was trying to select a number in 'xxxxxxxxx' where I should have been trying to select it without the ' ' .....
Apr 18 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Delete delete.... I've found it.

I was trying to select a number in 'xxxxxxxxx' where I should have been trying to select it without the ' ' .....
Glad you figured it out. Hopefully someone searching the same problem will find your solution.

Mary
Apr 18 '07 #3
Widge
56
Thats what I thought, nothing worse than finding something you've been trying to do and then hitting a dead ended thread. This place has been a fantastic resource for me!
Apr 19 '07 #4
MMcCarthy
14,534 Expert Mod 8TB
Thats what I thought, nothing worse than finding something you've been trying to do and then hitting a dead ended thread. This place has been a fantastic resource for me!
Glad to hear it.
Apr 19 '07 #5
mforema
72
Delete delete.... I've found it.

I was trying to select a number in 'xxxxxxxxx' where I should have been trying to select it without the ' ' .....
I have no idea what this means. I have a similar problem, and this doesn't help me. Can someone explain what this solution means?

Thanks!
~mforema
Jul 23 '08 #6
mforema
72
I have no idea what this means. I have a similar problem, and this doesn't help me. Can someone explain what this solution means?

Thanks!
~mforema
Haha, I just figured it out, too. Widge removed the single quotation marks around the combobox reference. I guess single quotation marks aren't used with numbers.

My code had something similar, where I reference a textbox that users type a number into. I removed the single quotation marks, and the code worked like a charm!

Thanks again!
Jul 23 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: frr | last post by:
Hi, After upgrading to 2.4 (from 2.3), I'm getting a weird syntax error: >>> import themes Traceback (most recent call last): File "<interactive input>", line 1, in ? File "themes.py", line...
2
by: Artur | last post by:
Hi Newsgroup, im currently working on programming a asp.net application consuming an Webservice hosted on Apache/Axis. I have generated WSDL and Proxy classes from VisualStudio.net. But when...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
7
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything...
24
by: ekz | last post by:
Hi guys I have a very weird bug and will welcome gracefully any help We developed ASP.Net application that run on production server, Net Framework 1.1 , IIS 6.0, the application is huge, having...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
1
by: noneedforthis | last post by:
I'm a new user of Access/VB and ran in to this nasty wall. (Access 2003, VB6.3, Windows XP) Runtime Error 2001: You cancelled the previous operation. The highlighted line is the one where the...
7
by: David01 | last post by:
When I run some code behind a button i get a runtime error message. The strange thing is that the code run perfectly some months ago. Can some one help me ! Some additional information: The company...
3
by: AccessBeetle | last post by:
I am creating simple login form with linked tables(atual tables are in SQL 2005) in access 2003. Here is my code. Option Compare Database Private Sub cmdSignIn_Click() 'Check to see if data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.