Results 1 to 11 of 11
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Boxes visibility (Access03)

    I am trying to make a credentialing checklist. I have everything set to shrink or grow as necessary and that works exactly like I want it to. The issue comes in when I put lines or boxes to mark where the learner and preceptor need to initial, date or check. Even though the header is set to shrink with the boxes it doesn't shrink. I then thought to set boxes to not be visible on the opening of the form and then make visible when the subsubtask or subtask is not null. But there is no Visible property when I went in to write code. So if I set the Visible property to no with the property dialog box how do I set visibility to yes when the txtSubSubTask is not null? Thank you.

    Fay

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Boxes visibility (Access03)

    Even if IntelliSense doesn't offer Visible in the list of properties, you can still type it yourself - it should work.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Boxes visibility (Access03)

    Sorry I didn't get back to you Hans to thank you for the info. It didn't make any sense to me why it wasn't showing so I just stopped. Here is the code I am trying to use. It must be the head congestion but I can't figure out why this doesn't work. I set the visible property for the boxes to be No in the property dialog box. The code works to the txtTask level. But the boxes show up for the txtSubTask and txtSubSubTask levels even when there is nothing at those levels for the specific txtTask. I have have copied the names of the both two levels to make sure this dyslexic person didn't misspell the name of the control. Thank you for your thoughts.

    Private Sub Report_Open(Cancel As Integer)
    If Not IsNull(txtTask) = True Then
    Me.Box6.Visible = True
    Me.Box10.Visible = True
    Me.Box13.Visible = True
    Me.Box16.Visible = True
    End If
    If Not IsNull(txtSubTask) = True Then
    Me.Box7.Visible = True
    Me.Box11.Visible = True
    Me.Box14.Visible = True
    Me.Box17.Visible = True
    End If
    If Not IsNull(txtSubSubTask) = True Then
    Me.Box8.Visible = True
    Me.Box12.Visible = True
    Me.Box15.Visible = True
    Me.Box18.Visible = True
    End If
    End Sub


    Fay

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Boxes visibility (Access03)

    Are you saying that when txtSubTask is null, Boxes 7, 11, 14 and 17 are visible? Try changing the test to this: <code>If IsNull(txtSubTask) = False Then</code>

    PS You can productively shortcut the code like this:

    <code>Me.Box7.Visible = Not IsNull(txtSubTask)</code>
    Charlotte

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Boxes visibility (Access03)

    Thanks for responding Charlotte.

    When txtSubTask is null, Boxes 7, 11, 14 and 17 are to be invisible. So I tried If IsNull(txtSubTask) = False and then True.

    I tried your shorthand aslo using the following. This didn't need to be a If statement did it?
    Me.Box6.Visible = Not IsNull(txtTask)
    Me.Box10.Visible = Not IsNull(txtTask)
    Me.Box13.Visible = Not IsNull(txtTask)
    Me.Box16.Visible = Not IsNull(txtTask)

    I also tried without the Not. Neither worked.

    This looks like it should be so straight forward I don't know why it isn't working. But I still get boxes for the two lowest level when there is not lower two levels.

    Thank you. Fay

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Boxes visibility (Access03)

    Perhaps the text boxes don't contain Null, but an empty string "". Try this:

    Me.Box6.Visible = Not (Nz(txtTask) = "")
    Me.Box10.Visible = Not (Nz(txtTask) = "")
    Me.Box13.Visible = Not (Nz(txtTask) = "")
    Me.Box16.Visible = Not (Nz(txtTask) = "")

    Me.Box7.Visible = Not (Nz(txtSubTask) = "")
    Me.Box11.Visible = Not (Nz(txtSubTask) = "")
    Me.Box14.Visible = Not (Nz(txtSubTask) = "")
    Me.Box17.Visible = Not (Nz(txtSubTask) = "")

    Me.Box8.Visible = Not (Nz(txtSubSubTask) = "")
    Me.Box12.Visible = Not (Nz(txtSubSubTask) = "")
    Me.Box15.Visible = Not (Nz(txtSubSubTask) = "")
    Me.Box18.Visible = Not (Nz(txtSubSubTask) = "")

  7. #7
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Boxes visibility (Access03)

    I got a runtime error:

    '-2147352567 (8002009)'; You entered an expression that has no value.

    Fay

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Boxes visibility (Access03)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions.

  9. #9
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Boxes visibility (Access03)

    Here it is. Thank you.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Boxes visibility (Access03)

    Ah! I thought the boxes were in the report header. Since they are in various group headers instead, you must use the On Format event of the group headers, not the On Open event of the report. and you can use IsNull after all. The code becomes:

    Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
    Me.Box6.Visible = Not IsNull(txtTask)
    Me.Box10.Visible = Not IsNull(txtTask)
    Me.Box13.Visible = Not IsNull(txtTask)
    Me.Box16.Visible = Not IsNull(txtTask)
    End Sub

    Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
    Me.Box7.Visible = Not IsNull(txtSubTask)
    Me.Box11.Visible = Not IsNull(txtSubTask)
    Me.Box14.Visible = Not IsNull(txtSubTask)
    Me.Box17.Visible = Not IsNull(txtSubTask)
    End Sub

    Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
    Me.Box8.Visible = Not IsNull(txtSubSubTask)
    Me.Box12.Visible = Not IsNull(txtSubSubTask)
    Me.Box15.Visible = Not IsNull(txtSubSubTask)
    Me.Box18.Visible = Not IsNull(txtSubSubTask)
    End Sub

  11. #11
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Boxes visibility (Access03)

    If you was state side I would treat you to dinner. This type of issue is what makes Access a challenge. Thank you I works exactly like I wanted it to. Fay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •