Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2012
    Posts
    11

    Tick Box Hides Text Box

    I've put a tick box on my form which , when ticked, hides a text box (called text41).

    The tick box is called Check45.

    Basically, I wrote an event based on various posts I have been looking at.

    Private Sub Check45_Click()
    If Active Then
    If Not Me.NewRecord Then
    Text41.Visible = False
    Else
    Text41.Visible = True
    End If
    End Sub

    This is in the event part of the property sheet, the On click part.

    Anyway, I cannot get it to work. I get a compile error whcih says,

    Compile error. Block if without End If.

    Any ideas anyone?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You started 2 If/Then blocks but only ended 1.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Try adding a second End If after the first End If.

    Alan

  4. #4
    Join Date
    Jan 2012
    Posts
    11
    Doh!!! How daft am I??

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This was a rare case of the error message actually being an accurate description of the problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. show text box if tick box is selected
    By zac123 in forum Access
    Replies: 16
    Last Post: 09-06-2015, 12:14 PM
  2. Password on a Tick Box?
    By wadey in forum Security
    Replies: 1
    Last Post: 04-25-2011, 12:40 PM
  3. Checkbox unable to tick on a report
    By sabre1 in forum Reports
    Replies: 0
    Last Post: 11-08-2010, 09:38 AM
  4. hide text box till you un-tick check box
    By islandboy in forum Access
    Replies: 14
    Last Post: 09-06-2009, 10:08 AM
  5. Form that hides information
    By dromorkid in forum Forms
    Replies: 0
    Last Post: 11-04-2008, 11:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums