Control button visiblilty

RenaG

Registered User.
Local time
Today, 01:32
Joined
Mar 29, 2011
Messages
166
I am working in Access 2007.

I have a splash form that allows users to identify themselves and select a program (type of cancer); each user defaults to a particular program but can select a different one. When they press OK, a Menu form displays. This form contains many buttons - mostly to run different reports.

What I would like to do is control which report buttons are displayed based on the program chosen. Is there a way to do that?

TIA,
~RLG
 
Rena:

In the On Open method of the menu, you can tell it which buttons to set as visible and which to set as not visible based on the program choice.

I don't know details of the application but I would use a select statement such as:

Code:
Select Case <field that contains the program name>
Case "Cancer type 1"
  Me.reportButton1.visible = true
  me.reportButton2.visible = false
Case "Cancer type 2"
  Me.reportButton1.visible = false
  me.reportButton1.visible = true
End Select

And so on.

I hope this helps...otherwise feel free to ask!

SHADOW
 
Perfect!!!! This is just what I was looking for. Thank you so much!

~RLG
 
Perfect!!!! This is just what I was looking for. Thank you so much!

~RLG

Most welcome! Glad I could help!

I get so much help from this forum that I'm delighted to contribute when I can.

:)

Good luck on the project.

SHADOW
 
I am very thankful for this forum also. I am sure I will be back with more questions in the future!

~RLG
 

Users who are viewing this thread

Back
Top Bottom