Run-time error '2001'

cardgunner

Registered User.
Local time
Today, 15:09
Joined
Aug 8, 2005
Messages
210
When I run a form by itself i get no errors.

I add it to another form as a subform and and I get the Run-Time error '2001' You canceled the previous opertion.

I hit the debug and it goes to some code I have
Code:
Private Sub cboproductid_AfterUpdate()

  Me.txtamount.Value = DLookup("[amount]", "producttbl", "[productid] = Forms![orderfrm]!cboproductid") 'Populate the Item's Price.

End Sub
what this does is it looks up a value that is related to the field and puts that value in another text box. Does that make sense.

I think i need to to put something in there that says this is now a form part of a larger form.

I'm real new to the code and have no idea what I'm doing BUT I love the aggrevation. ;)

In case you seen my previous post. This has nothing to do with it. I was waiting and taking my turn. I don't want to look to needy.
 
Last edited:
I'm not really sure here but try changing

Forms![orderfrm]!cboproductid

to

Me![orderfrm]!cboproductid
 
Thanks, I tried that. No luck.
 
Also I just noticed that when I select the productid it is not putting the value associated in the txtamount field.

Maybe that is because i get the error after I select the id.

Would the error then stop the process and not enter the value?

If that is so does that help in finding the cause of the error?
 

Users who are viewing this thread

Back
Top Bottom