View Full Version : Error opening report


wrekless
08-22-2000, 10:10 AM
I am getting the WIERDEST error message.

When I try to open a report, any mode, preview or normal, I get a Run Time Error 438:

Object doesnt support this property or method.

What's weird about this, is that the report opens for certain records, but not for others, in this report.

Anyone know what this error is, and how it relates to my form???

Appreciate any help.

Atomic Shrimp
08-23-2000, 12:33 AM
Could you post your code? - just the line that calls the report plus the report's record source.

Mike

wrekless
08-23-2000, 06:03 AM
On the Click event (printbutton):

Dim stDocName As String
stDocName = "Print Individual Detail Report Add"
DoCmd.OpenReport stDocName, acViewPreview
DoCmd.PrintOut acPages, 1, 2
DoCmd.Close acReport, stDocName

Here's the tricky part:

On the report, I've got an array with all the fieldnames (controls) in them.
(Example:

Dim AllFieldNames(1 To 39) As String

AllFieldNames(1) = "MANUF"
AllFieldNames(2) = "MODEL"
AllFieldNames(3) = "SCN"
AllFieldNames(4) = "CATID"
AllFieldNames(5) = "DWG_NO"
AllFieldNames(6) = "DWG_REV"
AllFieldNames(7) = "EQ_PKG"
etc.

On the report I have 4 fields for each element in the array (MANUF1, MANUF2,MANUF3, MANUF4) and so on. I only display the fields associated with what Unit we are on. So for unit 1, MANUF1, MODEL1, SCN1 are all made visible.

For intI = 1 To 39
fieldname = AllFieldNames(intI) & Me![UNIT]
Me.Controls(fieldname).Visible = True
Next intI

This works for units 1, 2 and 4. But for 3, I get the error message I posted above. This is really inconsistent. Is this some sort of Microsoft error???