473,503 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

greyed out command button-how to accomplish

7 New Member
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
2 8118
willakawill
1,646 Top Contributor
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
Sprint45
7 New Member
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

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

Similar topics

4
8782
by: Fred B | last post by:
I used VB about a month ago and I don't recall this being greyed out. How do I get it back? Thanks.
2
3994
by: mksql | last post by:
New to Tkinter. Initially, I had some code that was executing button commands at creation, rather than waiting for user action. Some research here gave me a solution, but I am not sure why the...
2
32145
by: Michelle Collier-Moore | last post by:
Please could someone offer some advice regarding adding references to an Access database? I tried to open a project a few days ago sent to me by someone whose developer had left the company. I...
0
2382
by: Pavs | last post by:
I have inherited a ms access database that i am meant to alter and make some changes to. The database was original i believe created in Access 2000 while now i am using Access 2002 and my OS is...
2
9933
by: Jacko | last post by:
I have a jazz records archive database which is supposed to be updatable via an input form. Despite setting the form's properties so that it will accept edits, deletes etc the new record button...
1
1764
by: generalpet | last post by:
I have created a command on a form that does Filter By Form. I also have a command that does Apply Filter, but when I use the Filter By Form command it greys out the Apply Filter that I created. ...
8
4663
by: EdB | last post by:
In VB6, you could set a check box to checked, unchecked, or greyed. The latter would be used to show a setting but disable the control. In .Net, the third choice is not greyed, but...
6
2193
by: Ryan | last post by:
Is there any way to disable controls without causing them to be greyed out? Such as text boxes, list boxes, etc. Thanks. Ryan
14
6541
by: TonyMacaroni | last post by:
Hi everyone, total newbie to all of this so please bear with me and help if you can! I'm creating a database for a charity using Access 2002 SP3, I have a form called "Member Data". Within the...
3
3732
by: barrygoodz | last post by:
I have set up links on a web page to Word files. When you click the link a dialog box opens asking whether to open or save the file. The default program to open the file is MS Word. So far so good....
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.