Display button only if data is available.

AC5FF

Registered User.
Local time
Today, 05:36
Joined
Apr 6, 2004
Messages
552
Not sure if this is possible - or what may be needed to even determine if it is.

I've got a form that lists anywhere between 5 and 20 accounts that require some type of action on today. On this form, I have a button that opens a subform to show any historical notes for this account.

This all works just as I would like it to. With one exception.

I would like to hide or not display the button if there are no historical notes for a particular account. Properties on the button do not seem to have what I need or I am missing something. I'm hoping someone here may know what I need to do?

Thanks
 
if your form is a continuous form, use conditional formatting, however this cannot be applied to buttons, instead use a textbox - however even with conditional formatting you cannot hide a control - other than setting the back and fore colours to match the form so it blends in - but it will still be active if a user was to click on it. You can disable it, but then it will still be shown greyed out. Catch 22

if your form is a single form (but sounds like it isn't), then you can use some vba code in the current event to set the buttons visible property to false
 
I am pretty green with creating forms. I usually just grab tables and run queries to get what I need - so I had to look up continuous/single/etc formatting explanations.

I hadn't considered changing colors. But that would work. Right now I've got a list of accounts and each has a button next to it to look up the note history. Anything I can do to differentiate (colors/hiding/etc.) which buttons have data to show and which do not will work for what I want to do.

As far as being active with or without data - again; that will not hurt anything. In some ways it may even be beneficial.

I've used conditional formatting a lot in Excel - never in Access though. I will have to play with that some. But any pointers would be appreciated.

Something to note. My initial form runs from a query, the subform runs off a completely different query...
 
conditional formatting in access is pretty much the same as excel - rules are same, order conditions in descending order >0, >10, >100 is wrong >100, >10, >0 is right

Something to note. My initial form runs from a query, the subform runs off a completely different query...
forms usually do - rule is one form, one table (assuming you want to be able to add/update records) - just note you cannot have a subform on a continuous main (initial) form
 
just note you cannot have a subform on a continuous main (initial) form

This is what I was running into, but caught a video (about the 6:20 mark) that says it is wrong. Access will tell you that it isn't possible, but you can override it.

I just tried it and it worked for me. Still haven't found conditional formatting, but I'm in an archaic business and I'm still running Access 2000. Maybe it's not a feature in my version. Still going to try because what I've set up works - just would prefer the button with some form of contitional formatting.
 
WoW I am blind today..
So I know now where to look/set conditional formatting. I just now need to get it to work.
My form displays Account, Status, and Send. The subform displays date and notes.
What I tried was:
[Form]![account tech notes].[notes] Is Not Null
and set the formatting for that field to have a yellow background.

This did not work. But, I'm open to suggestions on how to fix it.
 

Users who are viewing this thread

Back
Top Bottom