Error message

R

Ryan

I don't know if anyone can help me but I am getting a
weird error message. I want to see if a specific value
is contained within the results of a query. If it is I
would like to perform a specific action. To do this I
use the following sub:

Private Sub cmdSearch_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim intIncInfo As String

If txtLName <> "" And cboCustomer <> "" Then
stDocName = "frmResults"
Cmd.OpenForm stDocName, , , stLinkCriteria
If IsNull(DLookup
("[FULL SCREENING]", "qryReport_TypeResults"))Then
Forms!frmResults!tabFullScreening.Enabled = False
End If
Else
intIncInfo = MsgBox("You must enter part of the " & _
"applicant's last name and the company who " & _
"ordered " & vbCrLf & "the report before " & _
"searching for a record.", 16, "Incomplete Data")
End If

End Sub


This opens a form with a list box that gets its fields
from the query in question. When I run the DLookup
function I get an error message saying:

Run-Time error '2001':
You cancelled the previous operation.

Does anyone possible know what I can do to fix this?
If not can someone please tell me the correct syntax to
loop through the contents of a list box to see if a value
is contained in it? I have a vaque idea but I think I
have a few things wrong. Thanks for any help you can
give.

Ryan
 

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