Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2016
    Posts
    2

    Unanswered: MS Access hiding Combo Box on Form

    Hi all

    I hope someone can help, I have a form for a MS access table, I have a number of different combo boxes that I want to hide if a certain condition in another field is met. However to keep the size of the form down what I want to do is have say 2 combo boxes ontop of each other on the form. If the condition is true then combo box 1 is visable, if condition is not true that combo box 2 is visable. I have managed to show combo box 1, but when I make it so combo box 1 is not visiable there is just a blank space. I think it is because the combo box 2 which should be visible is not sent to the front......confusing I know but could anyone help please? Just for clarity in the design view of the form the combo boxes are actually on top of each other. My think is that I can keep the form size down if I do this other wise there is just too much data

    Thanks

    Steve

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    If 1 box is invisible,then the other should show, it doesn't need to be 'brought to the front'.

    'What about?
    Cbo1.visible= condition
    Cbo2.visible= not cbo1.visible

  3. #3
    Join Date
    Oct 2016
    Posts
    2
    Quote Originally Posted by ranman256 View Post
    If 1 box is invisible,then the other should show, it doesn't need to be 'brought to the front'.

    'What about?
    Cbo1.visible= condition
    Cbo2.visible= not cbo1.visible
    Thanks for the reply, Do I put that in VB?, I have put in the field that has the condition the following, Its in the actual form on load,

    Private Sub Form_Load()
    If Text181.Value = "GAS LIFT" Then
    Me.Combo175.Visible = True
    Me.Combo368.Visible = False
    Else
    Me.Combo175.Visible = False
    Me.Combo368.Visible = False
    End If

    If Text181.Value = "Producer" Then
    Me.Combo175.Visible = False
    Me.Combo368.Visible = True

    Else
    Me.Combo175.Visible = False
    Me.Combo368.Visible = False

    End If
    End Sub

    But when I use this it shows the combo box 175 when the condition is Gas Lift, but when I change it to "producer" Combox box 175 disappears and combo box 368 is not visable. I have also put this in against the on change event for the text box 181. Is there something I am doing wrong?

Posting Permissions

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