Bug Activating .orientation property on VB6 report

This is code taken from an App in which I am printing VB 6.0 datsheet reports from a form.

With rptCoverSheet2
  Set .DataSource = rsCoverSheet
  .DataMember = rsCoverSheet.DataMember
  DoEvents
    If PrintEm = True Then
'        .Orientation = PickedOrientation
        .PrintReport
    Else
        .Show vbModal
    End If
 
End With

Notice that the line
.Orientation = PickedOrientation
 is commented.

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.



'
LVL 1
mlcktmguyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
I would suggest that you reinstall VB SP (you need at least SP4 to use this property).
0
mlcktmguyAuthor Commented:
I have SP6 installed
0
Éric MoreauSenior .Net ConsultantCommented:
have you tried to reinstall it?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlcktmguyAuthor Commented:
Sorry, I wasn't clear.  Yes I did reinstall it.  Still got the same situation.
0
mlcktmguyAuthor Commented:
emoreau,
Thanks for your interest in my problem.  I did some more research and found the following.
Apparently I have a know problem because it is mentioned on the knowledgebase.  I quote it below:

"When you use this new Orientation property in Visual Studio 6.0 Service Pack 4, you may encounter the error below:

Compiler Error

Method or Data member not found.

To fix this error, delete the values for DataMember and DataSource properties of the Data Report and reassign these two properties with the original values."

This comment seems directly realted to my problem but I have a further dilemma because of the way I am currently generating the file to print the report.

What do I do with DataMember and DataSource to solve the problem?  When I defined my report all of the fields are unbound and I left DataMember and DataSource blank because I create the recordsets from proprietary file formats directly prior to executing the code which outputs the reports.  I have no Data Enviroment in this project.  An example of my code to create my DataMember and DataSource is below.  I take the fields from the Form and create a recordset then a record.  Finally I bind those fields to the DataReport fields.

Dim rsCoverSheet As New ADODB.Recordset

With rsCoverSheet
  .Fields.Append "lbl01", adVarChar, 30
  .Fields.Append "lbl02", adVarChar, 30
  .Fields.Append "lbl03", adVarChar, 30
  .Fields.Append "lbl04", adVarChar, 30
  .Fields.Append "lbl05", adVarChar, 30
  .Fields.Append "lbl06", adVarChar, 30
  .Fields.Append "lbl07", adVarChar, 30
  .Fields.Append "lbl08", adVarChar, 30
  .Fields.Append "lbl09", adVarChar, 30
  .Fields.Append "lbl10", adVarChar, 30
  .Fields.Append "lbl11", adVarChar, 30

  .Fields.Append "RptEvalDate", adVarChar, 20
  .Fields.Append "txt00", adVarChar, 240
  .Fields.Append "txt01", adVarChar, 240
  .Fields.Append "txt02", adVarChar, 240
  .Fields.Append "txt03", adVarChar, 240
  .Fields.Append "txt04", adVarChar, 240
  .Fields.Append "txt05", adVarChar, 240
  .Fields.Append "txt06", adVarChar, 240
  .Fields.Append "txt07", adVarChar, 240
  .Fields.Append "txt08", adVarChar, 240
  .Fields.Append "txt09", adVarChar, 240
  .Fields.Append "txt10", adVarChar, 240
  .Fields.Append "txt11", adVarChar, 240
  .CursorType = adOpenKeyset
  .LockType = adLockOptimistic
  .Open

    Dim f As New frmCoverSheet
    .AddNew
    ![lbl01] = f!FacilCap.Text
    ![lbl02] = f!ParticCap.Text
    ![lbl03] = f!Partic1Cap.Text
    ![lbl04] = f!Partic2Cap.Text
    ![lbl05] = f!SMECap.Text
    ![lbl06] = f!SME01Cap.Text
    ![lbl07] = f!SME02Cap.Text
    ![lbl08] = f!SME03Cap.Text
    ![lbl09] = f!SME04Cap.Text
    ![lbl10] = f!SME05Cap.Text
    ![lbl11] = f!SME06Cap.Text

    ![RptEvalDate] = f!dtPick.Value
    ![txt00] = f!CovText(0).Text
    ![txt00] = f!CovText(0).Text
    ![txt01] = f!CovText(1).Text
    ![txt02] = f!CovText(2).Text
    ![txt03] = f!CovText(3).Text
    ![txt04] = f!CovText(4).Text
    ![txt05] = f!CovText(5).Text
    ![txt06] = f!CovText(6).Text
    ![txt07] = f!CovText(7).Text
    ![txt08] = f!CovText(8).Text
    ![txt09] = f!CovText(9).Text
    ![txt10] = f!CovText(10).Text
    ![txt11] = f!CovText(11).Text
    .Update

    Set f = Nothing
   
End With
'
Printer.Orientation = PickedOrientation
With rptCoverSheet2
  Set .DataSource = rsCoverSheet
  .DataMember = rsCoverSheet.DataMember
  DoEvents
    If PrintEm = True Then
'        .Orientation = PickedOrientation
        .PrintReport
    Else
        .Show vbModal
    End If
 
End With
'
rsCoverSheet.Close
'
Set rsCoverSheet = Nothing

Any help would be greatly appreciated.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.