UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Disable a button or make it disappear    
 
   
moadams2
post Nov 2 2007, 02:00 PM
Post #1

UtterAccess Enthusiast
Posts: 70



I have a button on a form that runs a macro which appends data from one table to another, creating new records that are only partially filled out, then a second button is pushed which opens a form that allows the users to fill in the remaining information.

After pushing the button once is there a way to disable it or make it disappear?

I am not very good at coding so have mainly tried to work with macros...however I am willing to try anything.

Thanks for your help!
Go to the top of the page
 
+
Doug Steele
post Nov 2 2007, 02:07 PM
Post #2

UtterAccess VIP
Posts: 17,620
From: Don Mills, ON (Canada)



If the button has focus, there's no way to make it hide nor disable it. Move focus to some other control, though, and then it's a one-liner in VBA:

Me.NameOfControl.Visible = False (to hide it)

Me.NameOfControl.Enabled = False (to disable it)

(Moving focus to another control is simply Me.NameOfOtherControl.SetFocus)

Edited by: djsteele on Fri Nov 2 15:07:58 EDT 2007.
Go to the top of the page
 
+
moadams2
post Nov 2 2007, 02:11 PM
Post #3

UtterAccess Enthusiast
Posts: 70



Thanks for the quick response.

Can I do this within the macro code or do I need to make it a module? Can you sort of walk me through it?
Go to the top of the page
 
+
Aquadevel
post Nov 2 2007, 06:55 PM
Post #4

UtterAccess VIP
Posts: 6,898
From: Earth...



Personally, I never try and hide any buttons or controls in an application mainly because users will
say 'but it was there a minute ago!'. Its better IMHO, just to enable/disable controls on applications based upon
your clients needs and cause the least amout of 'issue's/questions' on why an application works one way one time, &
different another.

Ok, that was just my 2 1/2 cents worth. (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)
Go to the top of the page
 
+
moadams2
post Nov 5 2007, 07:15 AM
Post #5

UtterAccess Enthusiast
Posts: 70



Thanks. That is my preferred method. I was able to get the button to be disabled. I appreciate the help of the forum.
Go to the top of the page
 
+
Aquadevel
post Nov 6 2007, 12:52 PM
Post #6

UtterAccess VIP
Posts: 6,898
From: Earth...



moadams2,

Glad you have it working the way you want! (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)
I hope I didn't imply that Doug's suggestion/method was wrong.

Just disabling is my preferred method. (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 03:23 AM