We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Make command button visible if anything changes on a form

SteveL13
SteveL13 asked
on
Medium Priority
303 Views
Last Modified: 2012-05-11
I have a command button that by default is not visible.  But if any field data changes on the form I want the commnd button to appear.  How can this be done?
Comment
Watch Question

Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
The button is not a bound control.
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Sorry ... that's ok because the button does not hold data.  I was referring to text boxes, combos, list boxes, option groups, etc.

So ... it should work.  Easy to try ...

mx
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
What mx means, is if you have unbound controls on the form, like combo boxes for building filters etc, the Dirty property doesn't change when you change those controls.
Dirty changes when something attempts to change the data bound to the form.

Author

Commented:
For some reason this is not working.  I have the button set to not visible by default.  So when the form is launched it does not show up.  Then when I make an entry or a change to any field on the form the button still does not display as I would like it to.

--Steve
CERTIFIED EXPERT
Most Valuable Expert 2014

Commented:
Simplify first
In the Form Dirty Event put

Msgbox "I'm Dirty"

Now, make a change (add a character and remove it)
Do you get a message box?
Save the record.
Do another control

Which ones cause a message and which don't?
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Application Developer
CERTIFIED EXPERT
Top Expert 2007

Commented:
Steve ... can you show the code you used ?

mx

Author

Commented:
I sort of have this working but need a littel "tweak".  I have this in the ondirty event of the form...

    Me.Command517.Visible = True   (the visible property of Command517 is not visible by default.)

But when the user clicks the button that has become visible, the record is saved, and I want the button to not be visible again.  But it is remaining visible.

How can I make it not be visible once its been clicked?
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.