Error "You cancelled the previous operation"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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
 
Back
Top