By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,162 Members | 996 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,162 IT Pros & Developers. It's quick & easy.

greyed out command button-how to accomplish

P: 7
All,

I have a form called books that shows the book information and a lookup field that shows who has the book checked out. On the side i have command buttons for ADD, DELETE, NEXT RECORD, PREVIOUS RECORD nad CLOSE. I want to create a greyed out DELETE button so that the record cannot be deleted if the book is checked out (data in the chk'd out lookup field). if the field is empty or indicates an "in house" condition then the delete button is active. How would i do this and any help with the VBA code would be appreciated.

Thanks
Oct 11 '06 #1
Share this Question
Share on Google+
2 Replies


100+
P: 1,646
All,

I have a form called books that shows the book information and a lookup field that shows who has the book checked out. On the side i have command buttons for ADD, DELETE, NEXT RECORD, PREVIOUS RECORD nad CLOSE. I want to create a greyed out DELETE button so that the record cannot be deleted if the book is checked out (data in the chk'd out lookup field). if the field is empty or indicates an "in house" condition then the delete button is active. How would i do this and any help with the VBA code would be appreciated.

Thanks
Set the enabled property of the button to False at runtime:

cmdDelete.Enabled = False

and reset it if you want the user to be able to delete

cmdDelete.Enabled = True
Oct 11 '06 #2

P: 7
thanks, but if i'm not mistaken that means I have to change it to allow the user or me to delete. I want the program to recognize the CHk'd out fiels and determine the staus of the DELETE command button on its own.
Oct 11 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.