how to set page.visible to false in open or load event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gerry Goldberg
    New Member
    • Jul 2010
    • 11

    #1

    how to set page.visible to false in open or load event

    My form is based on a table of grant information. It has a page for the grant application (pgeApp) and a page for the Grant award (pgeAward). I would like to make the grant award page visible only when the application status (on pgeApp) is set to "Awarded". In the AfterUpdate event for the [Application status], I check to see if the status is "Awarded" and if it is, I set the visible property of pgeAward to true, and everything works fine. When the form opens however, I need to initialize this visibiliy for the pgeAward. I am using the same logic in the Open (or Load) event, but it doesn't work. The code I use is:
    Code:
    Me![pgeAward].Visible = Me![cboApplicationStatus].Column(1) = "Awarded"
    Can you tell me what I'm doing wrong, or if there is a better way to do this.

    Thanks,

    Gerry Goldberg
    Last edited by NeoPa; Jul 21 '10, 04:30 PM. Reason: Please use the [CODE] tags provided
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    I would expect the best place to put this code would be in the Form_Current() event procedure.

    I would also recommend putting the assertion within parentheses :
    Code:
    Me![pgeAward].Visible = (Me![cboApplicationStatus].Column(1) = "Awarded")

    Comment

    • Gerry Goldberg
      New Member
      • Jul 2010
      • 11

      #3
      Great! I followed your suggestion and it worked perfectly.

      Thanks for your help.

      Gerry Goldberg

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        No worries. A pleasure to help :)

        Welcome to Bytes!

        Comment

        Working...