Results 1 to 9 of 9
  1. #1
    Lesg is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Sep 2021
    Posts
    101

    Dropdown Disabled but enabled for new line items


    Hi Guys, I have an issue with a client who's raised concern over a sub form for line items in a invoice form. The problem is, all line item dropdowns on the subform are enabled allowing them to be edited, and additional line items be added if required.

    However, it appears some users occasionally, in error, are changing the product in the dropdown, rather than adding a new item at the bottom. So what I thought about was a way to disable the current line items dropdown, and just make the new row enabled.

    Click image for larger version. 

Name:	lock_current_orderline_items.JPG 
Views:	15 
Size:	30.2 KB 
ID:	48315

    The normal use of this form, is to edit order line items that have been placed. i.e. the quantity of the item, or delete item, so need a way to show the dropdown disabled but with the option to add a new item if required, which should be disabled when the user tabs through the form onto next row.

    Any suggestions appreciated.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,913
    Test for NewRecord ?
    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
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    use conditional formatting - something like this
    expression is......not isnull([cboProduct])

    and set the condition to disabled


    alternatively in the control properties set disabled=true and in conditional formatting

    expression is......isnull([cboProduct])

    and set the condition to enabled

    you might want to set exactly the same condition for the other editable controls so they cannot enter anything there until they have selected the product

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,913
    Quote Originally Posted by CJ_London View Post
    use conditional formatting - something like this
    expression is......not isnull([cboProduct])

    and set the condition to disabled



    alternatively in the control properties set disabled=true and in conditional formatting

    expression is......isnull([cboProduct])

    and set the condition to enabled

    you might want to set exactly the same condition for the other editable controls so they cannot enter anything there until they have selected the product
    @CJ_London
    For the first option, isn't that going to happen as soon as anything is entered (and possibly tabbed out of) ? When does CF take effect?
    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

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    No - not sure whether it is the after update, lost focus or exit event but it doesn't take effect until the user moves to a new control

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    IMO unbound combos are ok for filtering, but if you present them as bound controls, expect that users will accidentally alter the field in records. If only looking at data, I'd open that form with the combo(s) locked and provide some other way of adding items to it. That might be a command button to add list items or perhaps dbl click event on the locked combo, either of which could open an add items form. Opening said form in data entry mode would be different.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Lesg is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Sep 2021
    Posts
    101
    Quote Originally Posted by CJ_London View Post
    use conditional formatting - something like this
    expression is......not isnull([cboProduct])

    and set the condition to disabled


    alternatively in the control properties set disabled=true and in conditional formatting

    expression is......isnull([cboProduct])

    and set the condition to enabled

    you might want to set exactly the same condition for the other editable controls so they cannot enter anything there until they have selected the product
    Thanks for that suggestion, will test it out and feedback, thank you

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    Don’t think we are talking about unbound combos? What makes you think we are?

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    Didn't say we were. I'm saying don't use bound combos as fields in records unless you either expect users to accidentally alter data or do something to prevent it.
    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: 24
    Last Post: 09-14-2021, 02:37 PM
  2. Calculating number of items based on dropdown
    By arstueck in forum Queries
    Replies: 3
    Last Post: 06-14-2014, 01:51 PM
  3. Replies: 2
    Last Post: 11-21-2012, 04:32 PM
  4. Replies: 7
    Last Post: 11-20-2011, 08:34 PM
  5. Selecting multiple items from Dropdown
    By Kipster1203 in forum Forms
    Replies: 12
    Last Post: 06-07-2010, 09:20 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