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

docmd.openreport where clause question

Status
Not open for further replies.

ck1999

Technical User
Dec 2, 2004
784
US
If i am using the Docmd.openreport function and am using a In('a','b','c') type of where clause, how many different items can be in the list. I am having problems with creating this list it appears to be only using about 1/2 of my list and an error pops up with a "run time error" and only some of the where statement (about 1/2). The weird thing is I am using a variable for the where clause and I can do a msgbox prior to the docmd.openreport statement and it shows the list correctly.

Any ideas.

Chris
 
I am not aware of a length limit of the In operator.

However, the maximum length of the Where condition argument in the OpenReport method is 255 characters (in my version of Access, at least), so maybe your long In statement is exceeding that?

[pc2]
 
My understand is that the limit in vba is 32,768 but if using a macro then the where statement can only be 256. I do beleive this is the issue however from what I have read the docmd.openreport should allow a lot larger of a where statement.

I am using access 97.


Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top