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

Strange Error message

Status
Not open for further replies.

authorsami

Instructor
Sep 11, 2003
155
US
I get the following error (only sometimes) when I try to run a report based on a query.

"This expression is typed incorrectly or it is too complexz to be evaluated. Nuberic expression may contain too many complicated elements."

What I have is a form with a combo box that gives me 3 choices of Drs. to pull a report on. the code behind the combo box is below.

SELECT DISTINCTROW [qryAFullName].[AFullName] AS Expr1
FROM qryAFullName
GROUP BY [qryAFullName].[AFullName];

Once a Drs. name is selected the user clicks on a preview report button, the code behind that is

Private Sub Command2_Click()
On Error GoTo Err_Command2_Click

Dim stDocName As String

stDocName = "rptqryAudiologists"
DoCmd.OpenReport stDocName, acPreview

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub

The problem: On one of the Drs it gives me the report, everything is fine. On the other two Drs I get the previously stated error message.

Any comments/suggestions. I need help on this. I'm new so any thing you tell me needs to be really simple.

Thanks
Sharon


 
Yes it appears to run correctly. I only get the error on certain Drs. I even went in to be sure that the Dr in question was selected from the Dr Table.....

Now two of the Drs give me errors and only one works... So it has gone from bad to worse......

Boy I'm baffled...
Sharon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top