You cancelled the previous operation error

  • Thread starter gmazza via AccessMonster.com
  • Start date
G

gmazza via AccessMonster.com

I am getting this error and I tried Compacting and decompiling the database
and all that jazz and I still get this error. Its a 1 table database, nothing
complex going on here.
I have a form that I do a search on so information gets updated in my sub
form.
In my sub form I have more search criteria that should update to my sub sub
form. Right when I update the combo box in my sub form I am getting this
error message on this line:
Me("frm_OffsetWells_sub2").Form.RecordSource = LSQL

This line is in my After_Update Event on the combo box being updated.
frm_OffsetWells_sub2 is the name of my sub sub form.

Here is the entire code for this Event:

Dim LSQL As String

If Forms!frm_OffsetWells!Combo12 = "" Then
LSQL = "select * from dbo_DDXLMO"
LSQL = LSQL & " where WellType = '" & combo17 & "'"
Me("frm_OffsetWells_sub2").Form.RecordSource = LSQL
End If

Please help or let me know if you need more info!
Thanks!
 
G

gmazza via AccessMonster.com

Ok I found out why the problem is arising, but I still need help.
The WellType's datatype is a Number. If I change it to a Text than I don't
get the error.
But I need it as a number so is there a workaround so it can still do the SQL
statement with the datatype being a number?
 
B

Beetle

Remove the single quotes in the criteria part of your SQL statement.
It should be;

LSQL = LSQL & " where WellType = " & combo17

for a number data type
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top