Results 1 to 8 of 8
  1. #1
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78

    Dropdown not capturing selection


    I have a form that opens in datasheet view and allows the user to select options from dropdowns in some of the fields.
    When I use the form on its own the dropdowns can be selected, however, on once it's in the Navigation form, the dropdowns drop down but I can't make a selection.

    What is missing?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,989
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78
    Yes, but I need someone that has the same Access version to assist me in troubleshooting.

  4. #4
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,119
    If the combo boxes (=dropdowns) have their row sources dependent on other controls on the form the referencing of those controls changes when the form is embedded in another (navigation) form. Not sure if that is your problem as you seem to imply that the combos actually show you the options but you cannot select them which would imply a read-only type scenario.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,655
    Quote Originally Posted by carmenv323 View Post
    Yes, but I need someone that has the same Access version to assist me in troubleshooting.
    Take a copy of your database and strip out everything not needed to replicate the problem.
    That may make it more compatible with other versions.

    Many of us prefer to roll our own navigation pages rather than the native one. IIRC the native ones are a pain when trying to code references to the forms.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  6. #6
    carmenv323 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Oct 2021
    Location
    Massachusetts
    Posts
    78
    Quote Originally Posted by moke123 View Post
    Take a copy of your database and strip out everything not needed to replicate the problem.
    That may make it more compatible with other versions.

    Many of us prefer to roll our own navigation pages rather than the native one. IIRC the native ones are a pain when trying to code references to the forms.

    I hope I've accomplished the task, let me know if it still won't open
    Attached Files Attached Files

  7. #7
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by carmenv323 View Post
    I have a form that opens in datasheet view and allows the user to select options from dropdowns in some of the fields.
    When I use the form on its own the dropdowns can be selected, however, on once it's in the Navigation form, the dropdowns drop down but I can't make a selection.

    What is missing?
    It looks like the form(s) have the "Allow Additions", "Allow Deletions", "Allow Edits" and "Allow Filters" set to No. See Form " Property sheet/ Data Tab".
    When the Main Navigation Form opens, there is code that explicitly sets the Edit mode to False (Allow Edits = No)
    Code:
    'Main Navigation Form - Should always be first open
    bEditMode = False

    Then, (I used the form "frmOtherActiveAssignments") when the form "frmOtherActiveAssignments" opens, the Form_Load event fires:
    Code:
    Private Sub Form_Load()
        Me.AllowEdits = bEditMode   '<<-- forces Allow Edits to be False/No
        Me.AllowDeletions = False
        Me.AllowAdditions = False
        Select Case intAccess
            Case 0, -1
                'readonly (directors view)
                'TODO format for directors view
            Case 1, 2
            Case 3
            Case 4
                Me.AllowAdditions = True
        End Select
    End Sub

    To Edit a field, the "Allow Edits" property for the form MUST be set to Yes. So, in the upper right hand corner of the form is a button, "Edit Mode is Off". Clicking that button changes the caption of the button to "Edit Mode is On". You can now edit the combo boxes. Clicking the Edit Mode button again locks/prevents changing the combo box ("Edit Mode is Off").
    Code:
    Private Sub btnEditMode_Click()
        On Error GoTo ErrorHandler
        Dim obj As Object
        If bEditMode = False Then
            bEditMode = True
            Me.NavigationSubform.Form.AllowEdits = True
            Me.btnEditMode.Caption = "Edit Mode: On"
            
            'For Each obj In Me.NavigationSubform.Form
            '    obj.AllowEdits = True
            ' Next
            
        Else
            bEditMode = False
            Me.NavigationSubform.Form.AllowEdits = False
            Me.btnEditMode.Caption = "Edit Mode: Off"
            'For Each obj In Me.NavigationSubform.Form
            '    obj.AllowEdits = False
            ' Next
        End If
        
        Exit Sub
        
    ErrorHandler:
        Exit Sub
    End Sub
    ================================================== =========================


    --------------------------- Things I noticed ------------------------------------------------------

    The top two lines of EVERY module should be:
    Code:
    Option Compare Database
    Option Explicit
    After adding "Option Explicit" to every module and compiling the code, there will be many errors. Most are undeclared variables. One error is a misspelled parameter in a function.
    In MODULE1, there is a function
    Code:
    Public Function getValueFromPopUp(formName As String, PopUpControlNae As String, Optional MyOpenArgs As String = "None") As Variant
    This parameter name should be "PopUpControlName"



    There are a LOT of Look-up FIELDS in the tables. Most developers do not use Look-up FIELDS (Bad),different from Look-up TABLES (Good).

    See The evils of lookup fields

    ----------------------------------------------------------------------------------------------------------------


    The structure of these tables should be looked at. They have repeating fields....

    tbl_EstimateLog
    tbl_MultipleRequests
    tbl_Requests
    tbl_WSBActuals



    These tables have spaces/special characters in field names
    tbl_VoltClass
    tbl_ProjectSvc
    tbl_OtherAssignments




    I saw a lot of tables with a PK field name of "ID". I would rename the ID field to something more descriptive...... (I never use ID).

  8. #8
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,815
    @carmenv323; this is why you were called out for cross posting the way you did it - not for the fact that you did it. That link will explain.

    https://www.excelguru.ca/content.php?184
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 6
    Last Post: 11-15-2012, 02:38 PM
  2. Replies: 3
    Last Post: 08-29-2012, 10:53 PM
  3. Replies: 6
    Last Post: 05-24-2012, 11:07 AM
  4. Form dropdown selection
    By piper in forum Forms
    Replies: 2
    Last Post: 04-16-2011, 09:34 AM
  5. Replies: 2
    Last Post: 08-03-2010, 10:16 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