Access 2003 Database VBA not running in 2007 Access

S

Sarki

Hi

I have some very simple VBA code running to open reports in print preview
mode. The code works fine in Access 2003, but I had to upgrade to Access
2007 (to get free runtime deployment).

Now I get an object error, which is a real pain. Can someone please tell me
what has changed for Do.Cmd OpenReport in 2007 so I can fix the problem.

Many thanks

Sarki
 
B

BeWyched

Nothing has changed for the default report view.

So,
1. Your Do.Cmd OpenReport should be DoCmd.OpenReport
2. If 1. is a typo, what is your coding as the problem is probably elsewhere.
Cheers.

BW
 
S

Sarki

Hi there

Many thanks for your email. I have now found that, unlike Access03, I need
more commas to delimit the syntax of some Open codes (eg OpenForm), and the
names of some components have changed eg acEdit is now acFormEdit, the acView
has changed to acPreview etc. - at least I'm able to fix the problem now.

However, I am very grateful to you for confirming that the basics hadn't
altered which saved me lots of hunting around for answers. Many thanks again.

Cheers

Sarki
 
B

BeWyched

Hi Sarki

I should have mentioned that the codes had changed. I didn't as you
mentioned the report was to open in Print Preview view which is the default,
i.e. you don't need anything after the report name (unless you are applying a
filter of course).

Cheers.

BW
 

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