+ Reply to Thread
Results 1 to 7 of 7

.frmLISTBOX.Enabled = False NOT working

  1. #1
    Registered User
    Join Date
    10-19-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    .frmLISTBOX.Enabled = False NOT working

    I am having trouble with frmFORM.frmLISTBOX.Enabled = false
    It does not work in one particular section of code and I am going to make a guess here. The code is called from frmLISTBOX_Click and I am guessing that you cannot disable a list box while processing it. It's odd though that .frmLISTBOX.Visible = false does work in the same section of code. Can anyone enlighten me ???
    If I am right how do you disable a ListBox after a selection has been made. ie a record is being selected to be modified, the controls are enabled and the form awaits input.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: .frmLISTBOX.Enabled = False NOT working

    Quote Originally Posted by RogerTunnicl View Post
    ie a record is being selected to be modified, the controls are enabled and the form awaits input.
    I am unable to understand your expectation


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    10-19-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: .frmLISTBOX.Enabled = False NOT working

    I have a data entry form which contains a listbox at the bottom. It displaysall records in the file. By clicking on the listbox a record is selected, displayed on the form and the fields are enabled to allow data entry. Additionally I want the list box to be disabled while the data is entered and saved. (This seems to work OK in OpenOffice)

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: .frmLISTBOX.Enabled = False NOT working

    How about adding your code in the OnExit Event of frmLISTBOX? Because once the user selected the item and when he moves to next control then the Listbox will get disabled.

    Please Login or Register  to view this content.
    Is this helpful?

  5. #5
    Registered User
    Join Date
    10-19-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Angry Re: .frmLISTBOX.Enabled = False NOT working

    Could not find the event you are describing but coded the following:-

    Tran Type is the first data field on the form after the user has entered a Key value and is then adding or modifying a record

    Sub frmTRANTYPE_Enter ()
    .frmLISTBOX.Enabled = False

    ' .frmOZ.Enabled = False
    ' .frmOPENPRICE.Enabled = False
    ' .frmCLOSEPRICE.Enabled = False
    ' .frmPL.Enabled = False

    End Sub

    It works for every field on the form EXCEPT the LISTBOX
    Disabling the listbox does however work when control travels through a different part of the program. ie When the user selects the ADD function

    It's got me beat !!!!

  6. #6
    Registered User
    Join Date
    10-19-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: .frmLISTBOX.Enabled = False NOT working

    by the way, do you know where I can find all the sub names that relate to events on a form (field). ie:-

    frmTRANTYPE_Click()
    frmTRANTYPE_Enter()

    etc

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: .frmLISTBOX.Enabled = False NOT working

    If you select a control in the left hand dropdown above the code window you'll find all it's events listed in the right hand dropdown.

    When you select event you should see the code stub for that event.

    For example if you had a listbox called frmLISTBOX select in the left hand dropdown and then selected Exit from the left dropdown you would see this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 04-16-2013, 01:03 AM
  2. IF function false value not working
    By frustrated in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-10-2012, 05:38 PM
  3. Replies: 6
    Last Post: 01-05-2010, 11:09 AM
  4. Replies: 0
    Last Post: 08-03-2006, 02:50 PM
  5. spinbutton enabled = false not changing colour
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-14-2006, 07:10 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1