Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    Moorpark, CA
    Posts
    104

    Unanswered: Subform Enable issue

    Hi -

    I have yet another problem. I am finding many suggestions throughout the web, but have yet to find one that works. I have a form that has 4 tabs each containing a subform. There is a checkbox on the Main form that basically makes three of the four Tabs obsolete (There will never be any information in those subforms). I am trying to grey out the fields in the subform or the whole subform when the checkbox on the Mainform is checked. Also, I want to keep information from being added to those subforms. Meaning, if I cannot disable the fields, I want a warning of some sort if someone tries to enter a record.

    Does anyone know of a book that specializes in Visual Basic for Application in Access? I have a VB book that is great, but is not always useful for when I'm working strictly from Access. In case you are wondering, I have VB at home that I use, but at work we only have Access available to us.

    Thanks!

  2. #2
    Join Date
    Nov 2003
    Location
    Moorpark, CA
    Posts
    104
    Yeah! Figured it out. It was a problem with the event. I had tried many combinations of set up and of events, but I had missed this one.

    What I used was:
    Private Sub Form_Current()
    If Me.Checkbox = True Then
    Me.Subform.Visible = False
    Else: Me.Subform.Visible = True
    End If
    End Sub

    There may be a better way, but this works fine!

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    or alternatively

    Code:
    Private Sub Form_Current()
    Me.Subform.Visible = not Me.Checkbox
    End Sub
    If your company is serious about Access development then I'd suggest Access Developer xxxx, where xxx is the version you are using.
    published by Sybex.
    authors (of the 2002 version) Litwin, Getz & Gunderloy
    Get both the 'desktop' & 'enterprise' versions

Posting Permissions

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