Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Location
    Teas
    Posts
    28

    Unanswered: Grayed Out Text & combo box

    Format: ACCESS 97
    FORM: frmgroups (click on Invoice/Fnl Pkg tab)

    1. Combo box 1 = "BillingStructure" should always be enable.
    2. Combo box 2 = "Fee Waived" should be grayed out all the time only if the user pick "Fee Waived" from combo box 1.
    3. if user pick "fee waived" from billingstructure combo box then fee waived combo box should be enable.
    4. There are also some text associated with this, but i guess i can use the same method.

    any help will be appreciated.

    ==================================
    Private Sub BillingStructure_Change()
    If Me!BillingStructure = "Fee Waived" Then
    Me!Waiver_Reason.Enable = True
    Me!Waiver_Reason.Locked = False
    Else
    Me!Waiver_Reason.Enable = False
    Me!Waiver_Reason.Locked = True
    End If
    End Sub
    ==================================



    OTHER HELP THAT I RECEIVED BUT DID NOT WORK.....
    ====================================
    If this code is not working, then this will be due to the combo box probably having a number as the bound column. If this is the case, you will need to change your code to the following (or equivalent)

    code:
    --------------------------------------------------------------------------------
    Private Sub BillingStructure_Change()
    with me
    If .BillingStructure.column(1) = "Fee Waived" Then
    .Waiver_Reason.Enable = True
    .Waiver_Reason.Locked = False
    .FeeWaived.enabled = true
    Else
    .Waiver_Reason.Enable = False
    .Waiver_Reason.Locked = True
    .FeeWaived.enabled = False
    End If
    end with
    End Sub
    ==========================================
    Do I need to set the property to following for both combo box.

    Enable = Yes
    Lock = No

    As of now, it's not working. Please suggest.
    ==========================================
    Did Mark's demo help?
    The combo does not to be locked if you have set enabled = False as this will grey out the combo anyway. Your original coding is ok - did it disable the textbox Waiver_Reason - if it did , then you just need to add the enabled = false to the combo as well.
    If it does not work, then you are probably looking at the wrong combo column.
    Last edited by cool_guy_no_1; 09-16-03 at 01:22.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    sorry that i've given up downloading .mdb but here's a way to sort yourself out.

    are your combos are called what you think they are called?
    if necessary expose the properties with a right-click¦properties, then check properties¦other¦name
    let's imagine this turns up something banal like "Combo1", "Combo2"

    are your combos are returning the values you think they are returning?
    once you have a name, Alt-F11 to expose the code window and in the Combo1_AfterUpdate event add the line:
    msgbox Combo1.value , , ".Value for Combo1"

    etc for the other Combos (using the properties¦other¦name for each combo of course)

    experiment with the form, noting the value returned (especially for Combo1 when you select "fee waived" in Combo1

    now you know the name of your combos AND the values they return, the example code you received will work fine if you substitute the real name & value. this also works IF you user the correct names and .Value

    private sub Combo1_AfterUpdate()
    if Combo1.value = whatever the return was when you selected "fee waived" then
    Combo2.enabled = true
    else
    Combo2.enabled = false
    endif
    end sub

    izy

Posting Permissions

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