Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 2001 - You canceled the previous operation ?

Status
Not open for further replies.

tayse

Technical User
Jan 10, 2006
9
CA
Hi,

When I change the value of combo box, it gives me this
" Run-Time error '2001' You canceled the previous operation "

here is the code...

Private Sub cmbSize_Click()

Dim ebat As Variant
Dim idno As Integer


idno = Me.cmbStyleID.Column(0)
ebat = Me.cmbSize.Column(0)


Me.txtUnitPrice = DLookup("ebat", "SizePrice", "[styleid] = " & idno)

End Sub

Appreciate for any help.
 
I would think the error is caused by the DLookup function returning Null. One guess further - by the code - I suspect there's no field in the SizePrice table called "ebat".

One completely untested suggestion, is that what you're after is something like this:

[tt]Me.txtUnitPrice = DLookup("[" & ebat & "]", "SizePrice", "[styleid] = " & idno)[/tt]

Perhaps also surrounded by the NZ function?

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top