Problems with error 2001 still...

M

Mitch

...Hi again.

I posted the other week about the error message "Run-time
error 2001 - you cancelled the previous operation" and
someone suggested I check the spelling in the code, qry
and form realted to the problem. I have checked and run
over the problem again but I cannot find any typos that
would throw this error up. Here is the code behind the
form that I am using...

Private Sub cboIssue_AfterUpdate()

Dim strRez As Variant

'strRez = DLookup("[resolution]", "qryRez", "[Issue]=" &
Forms!frmsprt!cboIssue)
strRez = DLookup("[resolution]", "qryRez", "[Issue]='" &
Forms!frmsprt!cboIssue & "'")


If IsNull(strRez) Then
Me.txtDetail.Visible = True
Me.sfmResolution.Visible = False
Else
Me.txtDetail.Visible = False
Me.sfmResolution.Visible = True
End If

Me.sfmResolution.Requery

End Sub

And the qry is as follows...

SELECT tblIssue.Issue, tblIssue.Resolution
FROM tblIssue
WHERE (((tblIssue.Issue)=[form]![frmsprt]![cboIssue]) AND
((tblIssue.Resolution) Is Not Null));


This should be a very simple function but it is proving
hard to correct !!
Any advice greatly apreciated,

Mitch...
 
M

Mitch

Ok.. .following Kens advice and seeing it in text in my
own post, I used the imm windowm pain for the line of
code and gave me a better error description and the typo
was here...

WHERE (((tblIssue.Issue)=[form]![frmsprt]![cboIssue]) AND
((tblIssue.Resolution) Is Not Null));

Its said ut could not find frmsprt, which I knew to be
correct and the actual typo was " =[form]! ", which
should be " =[forms]! "

Thanks Ken.

-----Original Message-----
...Hi again.

I posted the other week about the error message "Run- time
error 2001 - you cancelled the previous operation" and
someone suggested I check the spelling in the code, qry
and form realted to the problem. I have checked and run
over the problem again but I cannot find any typos that
would throw this error up. Here is the code behind the
form that I am using...

Private Sub cboIssue_AfterUpdate()

Dim strRez As Variant

'strRez = DLookup("[resolution]", "qryRez", "[Issue]=" &
Forms!frmsprt!cboIssue)
strRez = DLookup("[resolution]", "qryRez", "[Issue]='" &
Forms!frmsprt!cboIssue & "'")


If IsNull(strRez) Then
Me.txtDetail.Visible = True
Me.sfmResolution.Visible = False
Else
Me.txtDetail.Visible = False
Me.sfmResolution.Visible = True
End If

Me.sfmResolution.Requery

End Sub

And the qry is as follows...

SELECT tblIssue.Issue, tblIssue.Resolution
FROM tblIssue
WHERE (((tblIssue.Issue)=[form]![frmsprt]![cboIssue]) AND
((tblIssue.Resolution) Is Not Null));


This should be a very simple function but it is proving
hard to correct !!
Any advice greatly apreciated,

Mitch...
.
 

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