Error "You cancelled the previous operation"

E

Eamonn

Hey I have a combo box programmed to return the numeric value selected in an
another combo box. However when I click on a value that presents itself in my
pull down menu in the combo box the form crashes and presents me with the
error " Run time error 2001 You cancelled the previous operation". I am then
presented with Me.RecordSource = QuerySTR as the error. I dont understand why
this the case??

Any thoughts Ladies and Gentleman,

-Eamonn
 
D

Douglas J Steele

Are you sure that QuerySTR is valid at that point? The error message you're
showing is sometimes used incorrectly when there's a reference in a query or
domain aggregate function (DLookup, DSum, etc) with an incorrect name in it.
 
E

Eamonn

solved it myself -jus had an extra quote in my coding from that was not needed

If (Me.Combo56.Value = 0) Then 'AMT CCY
QuerySTR = QuerySTR
Else
QuerySTR = QuerySTR + " and [sheet1].[LCL CCY ORDERED] = '" &
Val(Trim(Me.Combo56.Value)) & "'"
End If

Shoulda been

If (Me.Combo56.Value = 0) Then 'AMT CCY
QuerySTR = QuerySTR
Else
QuerySTR = QuerySTR + " and [sheet1].[LCL CCY ORDERED] = " &
Val(Trim(Me.Combo56.Value)) & ""
End If
 

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