Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 11th, 2005, 05:38 PM
Authorized User
 
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default how do i do this, or can it be done?

Hello,

I have an access report. In my detail line I have a field as an indicator for each record. There are 6 of these indicators; 1 through 6. So if the line printed is 1, I want a rectangle to be visible in a specific area of that layout. If the record indicator is 2, I want a rectangle to be visible in a different area and all other rectangles to become invisible.

I've done this to start with just to get the first box to appear, but it doesn't work:
In the 'ON FORMAT' property of the detail layout, I used 'code builder'. Here is the code:

If Indicator = 1 Then
    Access.acRectangle.boxTest.visible
Else
    Access.acRectangle.boxTest.invisible
End If


Does anyone have any suggestions?
Thanks!

 
Old March 11th, 2005, 05:43 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I would think that if each rectangle has a unique name i.e. rectNumberOne, then you could use code like

If Indicator = 1 Then
    rectNumber1.visible = True
Else
    rectNumber1.visible = False
End If

Mike

Mike
EchoVue.com
 
Old March 11th, 2005, 05:44 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Timbal25,
Check out using a case statement.

also to set the visible property you need to use true or false.
If Indicator = 1 Then
    Access.acRectangle.boxTest.visible = true
Else
    Access.acRectangle.boxTest.visible = false
End If


dartcoach
 
Old March 11th, 2005, 06:05 PM
Authorized User
 
Join Date: Aug 2003
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

AWESOME!!!! That works great.... Thanks both Mike and Dartcoach.










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.