This is code taken from an App in which I am printing VB 6.0 datsheet reports from a form.
Set .DataSource = rsCoverSheet
.DataMember = rsCoverSheet.DataMember
If PrintEm = True Then
' .Orientation = PickedOrientation
Notice that the line
.Orientation = PickedOrientation
The variable PickedOrientation is set in another module and I verfied that it is set correctly. Here's my dilemma. I inserted this code and tested this module successfully. The line was working perfectly to set the orientation of the printed output. Thinking I had this issue reolved I exited VB completely. Later in the day I was going to create an EXE to deliver to my client. Amazingly the statement which had compiled before was giving me a compile error even though I had made absolutely no changes. After much time and the efforts of my parter, he discovered the key. If while in VB development environment, the datasheet report 'rptCoverSheet2' was opened, the .orientation line would compile and function correctly. No changes to the report were required. The report could be opened and then immediately closed again. An .EXE created at this point functioned correctly. Once I exited VB and re-entered the line would not compile until I opened and the closed the report.
Can anyone explain this? It really sounds like something to report to MicroSoft.