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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time error - 2001

Status
Not open for further replies.

MaggieLeatherman

Programmer
May 9, 2004
59
US
I've been getting Runtime error '2001' , You cancelled the previous operation.... on the following code:

If Not IsNull(Me.BSRId) Then
Me.txtUnits = DLookup("UnitsACM", "GAMaterials", "[bsridfk] = Me.BSRId")
End If

Does anyone know what this means? Thanks, Maggie
 

Guessing that BSRId is of Text data type

If Me.BSRId & "" <> "" Then
Me.txtUnits = DLookup("UnitsACM", "GAMaterials", "[bsridfk] ='" & Me.BSRId & "'")
End If
 
MaggieLeatherman . . .

I don't think the code you posted is it. Post the rest of the code! . . .

Calvin.gif
See Ya! . . . . . .
 
I think Jerry's got it but, I'm assuming integer (ID)?

Me.txtUnits = DLookup("UnitsACM", "GAMaterials", "[bsridfk] =" & Me.BSRId )
 
So what happen to [blue]MaggieLeatherman?[/blue]

Calvin.gif
See Ya! . . . . . .
 
JerryKlmns, Zion7 . . .
MaggieLeatherman said:
[blue]I've been getting Runtime error '2001' , You cancelled the previous operation....[/blue]
I'm [purple]suspicious[/purple] its something else because this is the kind of error you get when you say . . . open a form or report and in the [blue]OnOpen event[/blue] set the [blue]Cancel arguement[/blue] to True!

Calvin.gif
See Ya! . . . . . .
 
AceMan,
I personally wouldn't be familiar with the "OnOpen"
event error, you mentioned but, I've seen it too
many times with the aggregte functions.
Any control typo, or syntatical error will do it.

Give it a try. put in a false control or table name,
or a syntaticaly incorrect criteria statement.

...so the minute I saw the criteria statement,
...If it wasn't this YET, it would be.
 
Zion7 . . .

Not doubting you at all. Just giving the logic behind my post . . .

Calvin.gif
See Ya! . . . . . .
 
TheAceMan1

Well, I was hopping for Maggie to through another exception after my post, (because I dont treat IDs to be of text data type[wink]), to reveal the real problematic point just like you said. But where is she?[ponder]

 
Thanks for all your help! I did have a syntax problem. It's working ok now! Maggie
 
Maggie, it's usually good practice to reveal the solution
(if it hasn't been already).
Some may still be in the dark, as to where the problem lies, ( I think there are many who follow/search the thread,
without actually interacting)?
 
MaggieLeatherman . . .

To get great answers and know whats expected of you in the forums be sure to have a look at FAQ219-2884 [thumbsup2]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top