Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 21st, 2006, 09:52 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to grey out a form field?

Hi,
   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.

Regrds,
Andy

Reply With Quote
  #2 (permalink)  
Old August 22nd, 2006, 05:34 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: CHENNAI, TAMILNADU, India.
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to anukagni Send a message via Yahoo to anukagni
Default

Okey,

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..

bye..
pap
Reply With Quote
  #3 (permalink)  
Old August 22nd, 2006, 06:42 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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?



mmcdonal
Reply With Quote
  #4 (permalink)  
Old April 29th, 2008, 09:59 AM
Registered User
 
Join Date: Apr 2008
Location: Bridgetown, Christ Church, Barbados.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Field_1
Field_2
Field_3
Field_4

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.

J.Murrell
Reply With Quote
  #5 (permalink)  
Old April 29th, 2008, 10:11 AM
Authorized User
 
Join Date: May 2007
Location: , , .
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would put in before update rather than after update

select case me.field1.value

  'if x is the situation
  Case a
      me.field2.enabled=false
      me.field3.enabled=false
      me.field4.enabled=false

  'if y is the situation
  case b
      me.field2.enabled=false
      me.field3.enabled=true
      me.field4.enabled=false

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.




Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.