Sorry if this is a noob question, but I have been given the dubious honour of supporting an ancient legacy Access 2000 .adp application, written badly by someone years ago who is no longer around, when i have little experience with Access or VB myself :)
I have set up a WinXP dev machine with Access 2000 (it's an Access 2000 project) to do some support work. There is a pre-existing line of code which is supposed to print a report, which calls DoCmd.OpenReport with 6 arguments:
DoCmd.OpenReport ReportName, acViewPreview, , "orderId = 1234", , Printtype
When I run it I get a compile error: "Wrong number of arguments or invalid property assignment".
So I used 'intellisense' on DoCmd.OpenReport, and my access VB code editor tells me it is expecting only 4 arguments, not 6: ReportName, acViewNormal, FilterName and WhereCondition. When I go to the object browser for the command, the definition is:
Sub OpenReport(ReportName, [View As AcView = acViewNormal], [FilterName], [WhereCondition]) Member of Access.DoCmd (i.e. 4 args)
Looking on various posts on the web, some people seem to be passing 4 args, some 6. What gives? I'm guessing there are different versions of Access code libraries, and I have the wrong one. But I have no idea where to start resolving this. Anyone know Access and can help me out?