Results 1 to 3 of 3
  1. #1
    floyd is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    66

    Hide or disable value choice in combobox.

    I have set up an access ID level for the users.
    I have a navbar (which loads in a subform) on the top of each page with combobox access to various forms.



    Based on the user level, I need the navbar combobox to either allow the user to see and have access to the values... or hide or disallow. (Whatever is easier... but hiding in the preferred way.

    Here is a piece of the original navbar code...

    Code:
    Private Sub CourseComboBox_Click()
    Dim strCourseCB As String
    
    If Me.CourseComboBox = "Submit Course" Then
      strCourseCB = "1_frmInputCourse"
    ElseIf Me.CourseComboBox = "Search Course" Then
      strCourseCB = "2_qryCourseFiles"
    
    End If
    DoCmd.Close
    DoCmd.OpenForm strCourseCB
    
    End Sub
    This is what I am TRYING to do... albeit unsuccessfully... (Non-working code in blue)

    Code:
    Private Sub Form_Open(Cancel As Integer)
    On Error GoTo Err_Form_Open
        
        If User.AccessID < 4 Then
            Me.CourseComboBox.value = "Search Course".Enabled = True
        Else
            Me.CourseComboBox.value = "Search Course".Enabled = False
        End If
        
    Exit_Form_Open:
        Exit Sub
    
    Err_Form_Open:
        MsgBox Err.Description
        Me.Visible = True
        Resume Exit_Form_Open
              
    End Sub
    
    
    Private Sub CourseComboBox_Click()
    Dim strCourseCB As String
    
    If Me.CourseComboBox = "Submit Course" Then
      strCourseCB = "1_frmInputCourse"
    ElseIf Me.CourseComboBox = "Search Course" Then
      strCourseCB = "2_qryCourseFiles"
    
    End If
    DoCmd.Close
    DoCmd.OpenForm strCourseCB
    
    End Sub

  2. #2
    floyd is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    66
    OR... can I do the following.
    Show different comboboxes altogether based upon User.ID level?

    Right now in Row Source I have
    Code:
    "Submit Course";"Search Course"
    Could I do something like...

    Code:
    If User.ID > 4 then
    Me.mycombobox = "Submit Course";"Search Course"
    Else
    me.mycombobox = "Search Course"
    End If
    Would that do in Row Source?

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe
    Me.CourseComboBox.value = "Search Course"
    Me.CourseComboBox.Enabled = True
    I have never tried setting properties in one line like you have. Maybe that is the issue.


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

Similar Threads

  1. Disable/Hide Quick Access Toolbar
    By Jackal in forum Security
    Replies: 10
    Last Post: 11-22-2012, 05:25 PM
  2. Combobox-dependent show/hide controls
    By focosi in forum Forms
    Replies: 3
    Last Post: 07-31-2011, 06:47 AM
  3. Replies: 5
    Last Post: 07-29-2011, 03:07 PM
  4. Replies: 5
    Last Post: 07-23-2011, 11:48 PM
  5. Replies: 1
    Last Post: 09-27-2010, 06:58 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