Results 1 to 3 of 3
  1. #1
    d_Rana_b is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2011
    Posts
    4

    Angry show subform depending on combobox

    Please help me I wanted to show subform depending on combobox in Access 2007 like this example in Attachment


    the problem is this code executed in Access 2003 but not executed in Access 2007

  2. #2
    PrintShopSup is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2010
    Posts
    11
    When I opened in 2010, it appeared to work as expected. The top form (2) opened when I selected a and (3) opened below when I selected b.

    Saw the code where you had in and the flow looks simple. Don't understand why it wouldn't excecute in MS 2007... I edited the code a little, adding "Public" to the first subroutine and put in a "Call" for each of the 2 private subroutines. The code still executed as expected, so I would try changing your code to what I have pasted below to see if it works for you.

    Code:
    Public Sub ShowSubform()
    If Combo2 = "a" Then
    SubForm2.Visible = True
    SubForm3.Visible = False
    ElseIf Combo2 = "b" Then
    SubForm2.Visible = False
    SubForm3.Visible = True
    End If
     
     
    End Sub
    Private Sub Combo2_AfterUpdate()
    Call ShowSubform
    End Sub
     
    Private Sub Form_Current()
    Call ShowSubform
    End Sub
    Couldn't give you a "why", but if it works...

  3. #3
    d_Rana_b is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2011
    Posts
    4
    Thank U PrintShopSup for your interest
    after suffering i explore the reason
    disable all macros cause this problem

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

Similar Threads

  1. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  2. Changing calculation depending on Combobox
    By GraemeG in forum Programming
    Replies: 29
    Last Post: 02-15-2011, 11:33 AM
  3. change a combobox value depending on another
    By emadaldin in forum Access
    Replies: 3
    Last Post: 01-17-2011, 01:06 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 PM

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