Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

適用對象

BoundObjectFrame 物件

Image 物件

OptionButton 物件

SubForm 物件

CheckBox 物件

Label 物件

OptionGroup 物件

TabControl 集合物件

ComboBox 物件

Line 物件

Page 物件

TextBox 物件

CommandButton 物件

ListBox 物件

PageBreak 物件

ToggleButton 物件

CustomControl 物件

ObjectFrame 物件

Rectangle 物件

您可以在 Visual Basic for Applications (VBA) 程式碼中,使用 IsVisible 屬性來判斷報表上的控制項是否可見。 讀/寫布林值

expression.IsVisible

運算式 必要。 傳回 [套用至] 清單中其中一個對象的表達式。

備註

IsVisible 屬性使用以下設定。

設定

描述

True

(預設) 控制項為可見。

False

控制項為不可見。

附註: 您只能在含有控制項之報表區段內的列印事件中設定 IsVisible 屬性。

您可以將 IsVisible 屬性和 HideDuplicates 屬性一起使用,以判斷報表上的控制項什麼時候為可見並顯示或隱藏其他控制項。 例如,您可以在文字方塊控制項因為含有重複的值而隱藏時,隱藏線條控制項。

範例

下列範例使用文字方塊的 IsVisible 屬性來控制報表上線條控制項顯示與否。 該報表以 [Products] 資料表為基礎,並使用下列三種屬性的控制項。

屬性

線條控制項

文字方塊 #1

文字方塊 #2

Name

Line0

CategoryID

ProductName

ControlSource

CategoryID

ProductName

HideDuplicates

Yes

No

Left

0

0

2.0

Top

0

.1

.1

Width

4.0

1.0

1.0


將下列程式碼貼入報表模組的宣告區段,然後檢視報表,查看由 IsVisible 屬性控制的線條格式設定:

Private Sub Detail_Print(Cancel As Integer, _
PrintCount As Integer)
If Me!CategoryID.IsVisible Then
Me!Line0.Visible = True
Else
Me!Line0.Visible = False
End If
End Sub

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×