Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 21st, 2006, 09:52 PM
Registered User
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to grey out a form field?

   How do i grey out a form field? I tried fieldname.visible , it turns out the field disappear from the form. Pls kindly help. Thnks.


Old August 22nd, 2006, 05:34 AM
Friend of Wrox
Join Date: Dec 2005
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni


Go to the from design view select the text box or combo box what ever you have then select properties and in the format tab on Backstyle keep it as transparent..

this should work..

Old August 22nd, 2006, 06:42 AM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

Why do you want to grey it out? Do you want to make it inactive, or just color it?

If you want to make it inactive, you click on the field in design view, go to its properties dialog box, then click the Data tab, and select Enabled = No. This will grey it out.

If you want to make this conditional based on some value (in a record, for example) then you check the condition, and use:

Me.TextBox.Enabled = False

I am pretty sure that last line will work. The code may be slightly different.

Does this help?

Old April 29th, 2008, 09:59 AM
Registered User
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

which event do you place that code on and do you place it on the field/s you wish to disable?

Here is my scenario.

I have a form that has 4 fields.


I want that when i select A from Field_1 that Field_2,3 and 4 are enabled and when Field_1 does not show A, Field_2,3 and 4 are disabled.

Old April 29th, 2008, 10:11 AM
Authorized User
Join Date: May 2007
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts

I would put in before update rather than after update

select case me.field1.value

  'if x is the situation
  Case a

  'if y is the situation
  case b

end select

if may be simpler to change the visibility properties to false that way the user doesn't get the chance to see non-relevant fields and avoids confusion.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Requery a Form Field from another Form rocknrisk Access 3 September 16th, 2005 03:51 PM
Grey row of datagrid without PostBack Dave_w3 Classic ASP Professional 1 April 20th, 2005 03:51 AM
Tip: How to 'grey-out' an image crmpicco Javascript How-To 2 April 14th, 2005 08:45 AM
'grey out' or 'disable' an image crmpicco Classic ASP Basics 2 April 12th, 2005 09:20 AM
CONVERT GREY TO BLACK MANOJMETAL BOOK: ASP.NET Website Programming Problem-Design-Solution 0 December 3rd, 2003 07:47 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.