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

DoCmd.OutputTo not working in Access 2002 from Access 2000 1

Status
Not open for further replies.

Bresart

Programmer
Feb 14, 2007
314
ES
Hi, i have a .mdb from Access 2000 and i need it works in Access 2002 (also in the rest of Access versions).

In the code the line

DoCmd.OutputTo acOutputReport, "report1", acFormatSNP, CurrentProject.Path & "\temp1.snp", False

has no response. Can it be a references problem?

It works perfectly in Access 2000 and Access 2007.

Thanks for any help given.
 
Have a look to see if any references are marked MISSING.
 
Thanks Remou.

No, there's no reference marked missing.

The only three references that my project use are:

- Visual Basic for Applications
- Microsoft Access XX.X Object Library
- Microsoft ActiveX Data Objects 2.1 Library

Is it possible that in different pcs or in different Access versions any of these three references could be marked as missing?
 
When in Access 2002 (aka XP) does the db compiles properly ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV, yes, i have made a compilation in Access 2002.

Thanks.
 
You may try to repair your office XP install.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Try replacing the constant with it's literal value

"Snapshot Format (*.snp)"

If this works, I suspect there's something wrong with the Access installation. Once, I think, I heard something with regards to using some localized version of Access and/or multi language pack, but the details escape me. Fixing the install, as PHV suggests might be a way, and perhaps also ensure one is on the last SP.

There might also be some info here
Roy-Vidar
 
Thanks PHV RoyVidar.

Replacing the constant with it's literal value didn't work.

Perhaps there's an instalation problem like you said, because the described one isn't the only i am having: a form with many controls hangs up with the status bar showing 'Calculating...', and some times the error An error has occured and Access must be closed appears.

I will check these problems in another pc with this Access version and will say.
 
Have you tried compact & repair, decompile, importing to a fresh database and all the other things you do when a database acts up?
 
One thing that's been known to cause something like that, is using conditional formatting, perhaps with a calculated control
But there could be a number of things, it'd be guessing... where one guess might be corruption. You might want to try the steps described here (/decompile) - note, between step 2 and 3, exit Access, and open the database again without any code being executed (hold Shift).

Roy-Vidar
 
Thanks Remou RoyVidar.

I have compacted & repaired, decompiled, imported into a new database, followed the steps in the link and i have left two problems:

1.- Which i have explained at the beginning of the thread: DoCmd.OutputTo doesn't work. I have checked it in several PCs with Windows XP, either with SP2 or SP3, and only in the installation of Access 2002 i have made of my own PC it works. The problem also exists in Access 2003 (Windows Vista). It works correctly in Access 2000 (Windows XP with SP2), Access 2003 (Windows XP SP2) and Access 2007 (Windows XP SP2, Windows Vista).





2.- I have a form with a continuous subform based on a sowing calendar table which has 6 fields: FromDay, FromMonth, ToDay and ToMonth, ExactDay, ExactMonth (that is, the sowing can be an exact day or in a short period of time). In the subform I want to represent where is the sowing moment into the year, through an horizontal band marked with ‘ene’, ‘feb’, all along it until ‘dec’.

For representing where is in that band the sowing moment I want the band shows a different color in this period or day: for that, I have put 365 textboxes over the band all them with transparent background, and with conditional formatting: if its value is 1 its background is red, if its value is 0 there’s no format condition. For stablishing its value, in its Control source property there’s a calling to a function: for example, in the first textbox corresponding to the day 1 ene it is:

= FillingCalendarBand(1;[FromDay];[FromMonth];[ToDay];[ToMonth];[ExactDay];[ExactMonth])

This function calculates if the day 1 ene is into the sowing period, and return the value 0 in negative case and the value 1 in positive case. And so on for the 365 days (365 textboxes). I haven’t found a better way of going around the matter of representing sowing period.

The problem could seem what the link said about conditional formatting in calculated controls: indeed it’s an endless loop that recalculates time and time again the day 1 ene case (I have put a MsgBox in the function that gives the first argument received -day number from 1 to 365- and MsgBox with number 1 appears without stopping). But I have removed the conditional formatting and exactly the same problem keeps being: the MsgBox with number 1 keeps appearing without stopping. It was only a test because I really need the conditional formatting to implement the calendar band in this way. I have also tested the conditional formatting programmatically, with the same result.

This problem only occurs in Access 2002 in Windows XP without SP3, i haven’t yet tested in Access 2003. The working is correct in Access 2000 (Windows XP with SP2), Access 2002 (Windows XP with SP3), Access 2003 (Windows XP with SP2, Windows Vista) and Access 2007 (Windows XP with SP2, Windows Vista).

Can anybody say where is the problem? Or if there can be a better way of doing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top