Refreshing Report in Access 2000

B

Bung

Hi,

I have a problem with refreshing a report. I've created a dynamic
report that contains hidden and visible subreports depending on user
input to the form. Theres a button I click on the form to open the
report. The form's event (onClick) procedure does checks and sets a
subreport's visible property to be true or false. The code looks
something like this:

Private Sub Command14_Click()
Dim varItem As Variant
Dim strTable As String
Dim stDocName As String
stDocName = "Database_Difference"
DoCmd.OpenReport stDocName, acPreview
For Each varItem In Me!List12.ItemsSelected
strTable = Me!List12.ItemData(varItem)
If strTable = "ATTRIBUTE_CODE" Then
Reports!Database_Difference.New_Records_Attribute_Code.Visible =
True
End If
Next varItem
End Sub

The problem is that the subreport "New_Records_Attribute_Code" is
still invisible, even though i changed the visiblity. I tried to use
Me.repaint, me.refresh, and me.requery (after the for loop). I know i
have to open the report first before I can change the subreport's
properties.

Any solutions?
 
Top