Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011

    Unanswered: Using option groups to show/hide subforms

    Hi there all,

    I am new to visual basic and i wanted to find out where i am going wrong on a piece of coding i have written.

    Here is the code i have written:

    Private Sub Prosjekt_AfterUpdate()

    If ProsjektValue = 1 Then
    [subform1].Visible = True
    [subform2].Visible = False
    [subform3].Visible = False
    End If

    If ProsjektValue = 2 Then
    [subform2].Visible = True
    [subform1].Visible = False
    [subform3].Visible = False
    End If

    If ProsjektValue = 3 Then
    [subform3].Visible = True
    [subform1].Visible = False
    [subform2].Visible = False
    End If

    End Sub

    As you may be aware, this code doesnt work, i just click all the buttons and nothing happens, no error messages, no nothing.

    Does anyone know why? Or perhaps have a better code that meets the same end?

    Thanks all,
    Geir Arne

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    Try using:
    If Prosjekt.Value = 1 Then
    Have a nice day!

Posting Permissions

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