By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,649 Members | 1,816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,649 IT Pros & Developers. It's quick & easy.

Runtime error 2001 - huge frustration

P: 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
Share this Question
Share on Google+
6 Replies


P: 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
Expert Mod 10K+
P: 14,534
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

P: 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
Expert Mod 10K+
P: 14,534
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

P: 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

P: 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

Post your reply

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