If Avail = No then button goes away.

Thumper75

Registered User.
Local time
Today, 08:06
Joined
Feb 6, 2017
Messages
37
Hi Everyone,
This one should be simple but is still cooking my noodle. I have a sub-form the finds and displays records where two conditions meet. In reach record I have placed and install button. If the part is not available, I would like to set the button to Visible = False. The code below does a good job of turning the button invisible, but it turns them off for all the records. Is there a way to be selective about it.

Code:
If Me.txt_avail = "No" Then
    Me.cmd_install.Visible = False
End If

I am thinking that this is either a For Each Loop (which I am still learning) or a record issue. Both of which I'm not sure how to fire. As always, many thanks in advance for your input.
 
Hi,


If your subform is a continuous form, then you are seeing the normal behavior because there is really only one control on the form (although it's displayed multiple times). The closest you can get to what you want is by using Conditional Formatting and disabling the button, rather than hiding it.
 
Thanks for the suggestion. I tried changing the Enable property and am still having the same issue. The conditional formatting function is working just fine, but its applying the conditional formatting to all the records.

Any idea how to apply a loop to check each record?
 
Hi,


When I said Conditional Formatting, I wasn't referring to using code. However, I just realized buttons don't have Conditional Formatting. So, the closest you can get is to use a Textbox behaving (and maybe looking) like a button.


Hope it helps...
 

Users who are viewing this thread

Back
Top Bottom