Javascript required
Skip to content Skip to sidebar Skip to footer

Microsoft Access Disable Button on Continuous Form

  1. Continuous Forms text box if null then disable

    Hi all,

    I have one Db in forms Form3 its gives me the individual brokers total on continuous form,

    i want to hide the text box if total is "0"

    i have used: on Current

    Private Sub Form_Current() If Me.BAL = 0 Then

    Me.Detail.Visible = False

    End If
    End Sub

    even text box but its hide all detail or text boxes even there are value.

    i want to hide only those text box which value is null means 0

    please find the attachment and refer form3 on concatenate - AD40123 , Entry Date - 27-04-2012

    and press click me button. Thanks!!


  2. Conditional Formatting will allow you to disable individual TextBoxes but hiding them is a different story.

  3. Thanks for your reply !!! I want disable not hide, apologies for that and it is possible through condition format but how could you please explain it would be great for me thanks!!!

  4. Have you played with Conditional Formattiong yet? In design view just RightClick on the control and select ConditionalFormat. Then try some of the variations until you get it the way you want. Post back here if your still having trouble and we can help.

  5. yes i know but not much please help me on expression on how to disable.

    could you please help on expression....


  6. I would start with IF FIELD VALUE IS = 0 and select the disable icon (on the right) and give it a try.

  7. Hi and what about the hide actually i want to hide the boxes both Broker Name and Bal if value is 0 please sorry!!!!

  8. It is a Continuous Form but you do not want there to be an even number of fields (controls) in each record?

  9. Thanks!! actually what i want is Bal is 0 it for that broker name and Bal text boxes should not be display in detail, if there value is greater than 0 or less than 0 it should display.

  10. I never noticed the enable/disable icon on the conditional formatting dialog. Maybe is new to 2010, will have to check my 2007 version later.

    So if it is not on the 2007 version, will need to use code to enable/disable control. I use only VBA, don't know if macro can do it.
    Private Sub Form_Current()
    Me.Bal.Visible = Nz(Me.Bal) <> 0
    End Sub


  11. Quote Originally Posted by shree View Post

    Thanks!! actually what i want is Bal is 0 it for that broker name and Bal text boxes should not be display in detail, if there value is greater than 0 or less than 0 it should display.

    How about *not* pulling the record when the Bal = 0? Do it in the query.

  12. Right, if you don't want name or bal to show, why retrieve the record and end up with blank space because the control is still populated, just not visible.

    I just tested the enable icon setting of conditional formatting. The control is disabled but still visible.


  13. Hi JUNE, For your VBA code i have used in on current but "me.Bal.value there is no argument for visible after . there is only value is showing

    instead of bal i took text25 its working but both detail texts are disappear even one has BNP has position (value)


  14. hi june what should i do ?

  15. Quote Originally Posted by June7 View Post

    ...I never noticed the enable/disable icon on the conditional formatting dialog. Maybe is new to 2010, will have to check my 2007 version later.

    Nope! It's definitely been there since 2003 and I believe it's been there since the beginning of CF, v2000. It's the last icon on the right, just beyond the big A of the Font/Fore Color icon. To me it's always looked like a small button that has been disabled itself! I think I was using v2000 for six months before I noticed it!

    I think the only change made to Conditional Formatting, since the Access Gnomes first spit it out, is the rumored extension of the number of Conditions allowed from three (plus the Default) to a reported 10/20/50 (depending on the rumor source) in v2010!

    Linq ;0)>

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007


blackwoodmoratte.blogspot.com

Source: https://www.accessforums.net/showthread.php?t=24969