Open a form with specific records

D

Dan

I have a button that opens a form with certain records:

DoCmd.OpenForm stDocName, , , stLinkCriteria

The where condition is determined by different values from a record, however
it is often too long and the end part gets cut off. Any suggestions on what I
can do.
 
W

Wayne Morgan

The maximum length of the wherecondition argument is 32,768 characters. Are
you exceeding this? If so, you may need to base the form on a query and
rewrite the SQL of the query before opening the form. Another option would
be to use a temporary table linked to the main table in the query based on
the field that you want to filter on. Add the values you want to see to the
field in this temporary table. The link will cause only the records that
have matching values in the main table to be displayed.
 
D

Dan

ok there is no way that I am exceeding that. It must be an error somewhere
else. Thanks
 
Top