Greying out fields

Can Access grey out fields on a form depending on whether or not a tick box 
is ticked? And if it can how do I do it?!
0
Utf
1/10/2008 9:18:00 AM
access.forms 6864 articles. 1 followers. Follow

6 Replies
754 Views

Similar Articles

[PageSpeed] 47

In the AfterUpdate event of the checkbox, put code like:

Private Sub Check0_AfterUpdate()

  Me.Text1.Enabled = Not Me.Check0

End Sub

That will gray out (disable) the field when the check box is checked, and 
enable it when the check box is unchecked.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Sel" <Sel@discussions.microsoft.com> wrote in message 
news:A8228921-D4A4-410C-A3E5-754967038C41@microsoft.com...
> Can Access grey out fields on a form depending on whether or not a tick 
> box
> is ticked? And if it can how do I do it?! 


0
Douglas
1/10/2008 11:25:35 AM
Thankyou, I've got it to work for one text box. Is it possible to disable 
multiple fields (text boxes and drop-downs) by checking one check box?

"Douglas J. Steele" wrote:

> In the AfterUpdate event of the checkbox, put code like:
> 
> Private Sub Check0_AfterUpdate()
> 
>   Me.Text1.Enabled = Not Me.Check0
> 
> End Sub
> 
> That will gray out (disable) the field when the check box is checked, and 
> enable it when the check box is unchecked.
> 
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
> 
> 
> "Sel" <Sel@discussions.microsoft.com> wrote in message 
> news:A8228921-D4A4-410C-A3E5-754967038C41@microsoft.com...
> > Can Access grey out fields on a form depending on whether or not a tick 
> > box
> > is ticked? And if it can how do I do it?! 
> 
> 
> 
0
Utf
1/10/2008 12:49:00 PM
Sure. And, in fact, you can do different things for different controls. For 
instance, if you want a check in Check0 to disable Text1 and Text2, and 
enable Text 3 (or no check in Check0 to enable Text1 and Text2 and disable 
Text3), you'd use

Private Sub Check0_AfterUpdate()

  Me.Text1.Enabled = Not Me.Check0
  Me.Text2.Enabled = Not Me.Check0
  Me.Text3.Enabled = Me.Check0

End Sub


-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Sel" <Sel@discussions.microsoft.com> wrote in message 
news:05C79D04-95D4-4A5F-95F5-7E6208A394D8@microsoft.com...
> Thankyou, I've got it to work for one text box. Is it possible to disable
> multiple fields (text boxes and drop-downs) by checking one check box?
>
> "Douglas J. Steele" wrote:
>
>> In the AfterUpdate event of the checkbox, put code like:
>>
>> Private Sub Check0_AfterUpdate()
>>
>>   Me.Text1.Enabled = Not Me.Check0
>>
>> End Sub
>>
>> That will gray out (disable) the field when the check box is checked, and
>> enable it when the check box is unchecked.
>>
>> -- 
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>> "Sel" <Sel@discussions.microsoft.com> wrote in message
>> news:A8228921-D4A4-410C-A3E5-754967038C41@microsoft.com...
>> > Can Access grey out fields on a form depending on whether or not a tick
>> > box
>> > is ticked? And if it can how do I do it?!
>>
>>
>> 


0
Douglas
1/10/2008 1:06:54 PM
Thanks, I tried that and the first time instead of disabling both Text 1 and 
Text 2 it disabled Text 1 and cleared the information from Text 2! I've now 
retried and now I can't get it to disable anything at all! Even when I 
recreate a brand new form and try it on that it still won't work!

Is there some sort of option I may have pressed that has stopped this from 
working?

"Douglas J. Steele" wrote:

> Sure. And, in fact, you can do different things for different controls. For 
> instance, if you want a check in Check0 to disable Text1 and Text2, and 
> enable Text 3 (or no check in Check0 to enable Text1 and Text2 and disable 
> Text3), you'd use
> 
> Private Sub Check0_AfterUpdate()
> 
>   Me.Text1.Enabled = Not Me.Check0
>   Me.Text2.Enabled = Not Me.Check0
>   Me.Text3.Enabled = Me.Check0
> 
> End Sub
> 
> 
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
> 
> 
> "Sel" <Sel@discussions.microsoft.com> wrote in message 
> news:05C79D04-95D4-4A5F-95F5-7E6208A394D8@microsoft.com...
> > Thankyou, I've got it to work for one text box. Is it possible to disable
> > multiple fields (text boxes and drop-downs) by checking one check box?
> >
> > "Douglas J. Steele" wrote:
> >
> >> In the AfterUpdate event of the checkbox, put code like:
> >>
> >> Private Sub Check0_AfterUpdate()
> >>
> >>   Me.Text1.Enabled = Not Me.Check0
> >>
> >> End Sub
> >>
> >> That will gray out (disable) the field when the check box is checked, and
> >> enable it when the check box is unchecked.
> >>
> >> -- 
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no e-mails, please!)
> >>
> >>
> >> "Sel" <Sel@discussions.microsoft.com> wrote in message
> >> news:A8228921-D4A4-410C-A3E5-754967038C41@microsoft.com...
> >> > Can Access grey out fields on a form depending on whether or not a tick
> >> > box
> >> > is ticked? And if it can how do I do it?!
> >>
> >>
> >> 
> 
> 
> 
0
Utf
1/10/2008 2:35:03 PM
What's the exact code you've got? (copy-and-paste, rather than retype)

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Sel" <Sel@discussions.microsoft.com> wrote in message 
news:031F1694-6128-4566-B5AD-660C1B3C36B4@microsoft.com...
> Thanks, I tried that and the first time instead of disabling both Text 1 
> and
> Text 2 it disabled Text 1 and cleared the information from Text 2! I've 
> now
> retried and now I can't get it to disable anything at all! Even when I
> recreate a brand new form and try it on that it still won't work!
>
> Is there some sort of option I may have pressed that has stopped this from
> working?
>
> "Douglas J. Steele" wrote:
>
>> Sure. And, in fact, you can do different things for different controls. 
>> For
>> instance, if you want a check in Check0 to disable Text1 and Text2, and
>> enable Text 3 (or no check in Check0 to enable Text1 and Text2 and 
>> disable
>> Text3), you'd use
>>
>> Private Sub Check0_AfterUpdate()
>>
>>   Me.Text1.Enabled = Not Me.Check0
>>   Me.Text2.Enabled = Not Me.Check0
>>   Me.Text3.Enabled = Me.Check0
>>
>> End Sub
>>
>>
>> -- 
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>> "Sel" <Sel@discussions.microsoft.com> wrote in message
>> news:05C79D04-95D4-4A5F-95F5-7E6208A394D8@microsoft.com...
>> > Thankyou, I've got it to work for one text box. Is it possible to 
>> > disable
>> > multiple fields (text boxes and drop-downs) by checking one check box?
>> >
>> > "Douglas J. Steele" wrote:
>> >
>> >> In the AfterUpdate event of the checkbox, put code like:
>> >>
>> >> Private Sub Check0_AfterUpdate()
>> >>
>> >>   Me.Text1.Enabled = Not Me.Check0
>> >>
>> >> End Sub
>> >>
>> >> That will gray out (disable) the field when the check box is checked, 
>> >> and
>> >> enable it when the check box is unchecked.
>> >>
>> >> -- 
>> >> Doug Steele, Microsoft Access MVP
>> >> http://I.Am/DougSteele
>> >> (no e-mails, please!)
>> >>
>> >>
>> >> "Sel" <Sel@discussions.microsoft.com> wrote in message
>> >> news:A8228921-D4A4-410C-A3E5-754967038C41@microsoft.com...
>> >> > Can Access grey out fields on a form depending on whether or not a 
>> >> > tick
>> >> > box
>> >> > is ticked? And if it can how do I do it?!
>> >>
>> >>
>> >>
>>
>>
>> 


0
Douglas
1/10/2008 4:12:20 PM
Aah, it's ok now! Someones just pointed out to me that I'd got them the wrong 
way round. Thankyou very much for your help - it's much appreciated!

Sel

"Douglas J. Steele" wrote:

> What's the exact code you've got? (copy-and-paste, rather than retype)
> 
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
> 
> 
> "Sel" <Sel@discussions.microsoft.com> wrote in message 
> news:031F1694-6128-4566-B5AD-660C1B3C36B4@microsoft.com...
> > Thanks, I tried that and the first time instead of disabling both Text 1 
> > and
> > Text 2 it disabled Text 1 and cleared the information from Text 2! I've 
> > now
> > retried and now I can't get it to disable anything at all! Even when I
> > recreate a brand new form and try it on that it still won't work!
> >
> > Is there some sort of option I may have pressed that has stopped this from
> > working?
> >
> > "Douglas J. Steele" wrote:
> >
> >> Sure. And, in fact, you can do different things for different controls. 
> >> For
> >> instance, if you want a check in Check0 to disable Text1 and Text2, and
> >> enable Text 3 (or no check in Check0 to enable Text1 and Text2 and 
> >> disable
> >> Text3), you'd use
> >>
> >> Private Sub Check0_AfterUpdate()
> >>
> >>   Me.Text1.Enabled = Not Me.Check0
> >>   Me.Text2.Enabled = Not Me.Check0
> >>   Me.Text3.Enabled = Me.Check0
> >>
> >> End Sub
> >>
> >>
> >> -- 
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no e-mails, please!)
> >>
> >>
> >> "Sel" <Sel@discussions.microsoft.com> wrote in message
> >> news:05C79D04-95D4-4A5F-95F5-7E6208A394D8@microsoft.com...
> >> > Thankyou, I've got it to work for one text box. Is it possible to 
> >> > disable
> >> > multiple fields (text boxes and drop-downs) by checking one check box?
> >> >
> >> > "Douglas J. Steele" wrote:
> >> >
> >> >> In the AfterUpdate event of the checkbox, put code like:
> >> >>
> >> >> Private Sub Check0_AfterUpdate()
> >> >>
> >> >>   Me.Text1.Enabled = Not Me.Check0
> >> >>
> >> >> End Sub
> >> >>
> >> >> That will gray out (disable) the field when the check box is checked, 
> >> >> and
> >> >> enable it when the check box is unchecked.
> >> >>
> >> >> -- 
> >> >> Doug Steele, Microsoft Access MVP
> >> >> http://I.Am/DougSteele
> >> >> (no e-mails, please!)
> >> >>
> >> >>
> >> >> "Sel" <Sel@discussions.microsoft.com> wrote in message
> >> >> news:A8228921-D4A4-410C-A3E5-754967038C41@microsoft.com...
> >> >> > Can Access grey out fields on a form depending on whether or not a 
> >> >> > tick
> >> >> > box
> >> >> > is ticked? And if it can how do I do it?!
> >> >>
> >> >>
> >> >>
> >>
> >>
> >> 
> 
> 
> 
0
Utf
1/10/2008 4:20:01 PM
Reply:

Similar Artilces:

Populating a field conditional of the input of two cells
Hello All, I'm trying to write a simple formula that puts a specific answe conditional of the answers supplied in two other cells. I have followe the formula structure as I understand it, however microsoft Excel X doesn't like the (and statements. Could anyone enlighten me on th correct way of doing this? Many thanks. (The formula is below) > =IF(AND(F4=1,F6="XLPE"),"1",IF(AND(F4<>1,F6="XLPE"),"2",IF(AND(F4=1,F6="PE"),"3",IF(AND(F4<>1,F6="PE"),"4",IF(AND(F4=1,F6="PVC"),"5&quo...

Cells (some) being Greyed In: How To Remove Grey ?
Hello, Using Excel 97. Some of the cells, but not all, are greyed in (cell background, I guess you'd term it). Don't know how it happened, but don't want it this way. How can I get all the cells to have the normal white background (with black text) ? Thanks, Bob Right mouse click cells that are affected and go to format cells and patterns tab and click "no colour" has other options there for font colour etc. Robert11 wrote: > Hello, > > Using Excel 97. > > Some of the cells, but not all, are greyed in (cell background, I guess > you'd ...

query destination field
How do you change a destination field of a query in Excel? I have the data from the query being sent to cell A4 but need it to go to cell A1. I tried the "edit query" option but with no luck albert I think you can just delete Rows 1:3 and it will adjust accordingly. -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "albert" <anonymous@discussions.microsoft.com> wrote in message news:14E1E67B-F7A0-4FD3-A78E-C4E1CCC22453@microsoft.com... > How do you change a destination field of a query in Excel? I have the data from the query b...

UserForm
Greetings, This is quite complex to explain but here goes, below is a mock up of my user form:- Label Title <Value> *Populated from result of combo box1 Combo Box 1 <Value select> Text Box <Value = 'Todays date"> *Populated from result of combo box1 Combo Box 2 <Value select> The form is launched and ONLY Combo Box 1 is set to visible (others on intilisation of form have visible set to FALSE) The user selects a value in Combo box 1 and label and text box are populated and Combo box 1 is then set to disabled (ENABLED = FALSE). The user can either c...

wmp10 "choose columns" greyed out
This may be a duplicate post. My computer crashed while I was posting it, so I don't know if it went through. Anyway, my problem is with WMP10. There used to be an option to see the song titles (probably an older version), and I don't see that anymore. Under "All music" there is "Artist/Album" and all I see is the artist. I went to "View" to try and add columns, and the option for "choose columns" is greyed out. Any ideas on how to fix this? I'm not too familiar with WMP (was using WINAMP) so any help would be appreciated. ...

Auto Fill Form fields based on another field's value using a IIF
Hello once again...I'm back I am trying to have the value for our Zipcode field to automatically be added based on what city we select from our combo box for cities. Zipcode field = Zipcode City combobox field = lucity I have tried using the IIF statement IIf([lucity]=Belton,[Zipcode]=29627,0) placed in the properties of the Zipcode field in the form but it doesn't work. I have about 12 cities to do this with. Any suggestions? Thanks -- JCW On Sat, 27 Feb 2010 10:44:01 -0800, JohnW <JohnW@discussions.microsoft.com> wrote: >Hello once again...I&#...

deleting duplicate fields
I have a mailing list in excell worksheet. I want to mail only one letter to household. however, ther are sometimes 3 different names at same address. How can I filter out and delete duplicate addresses. example. jane smith 123 south street anytown, usa john smith 123 south street anytown, usa deb smith 123 south street anytown, usa john smith 566 different street anytown, usa Elaine Suggest you go to Data>Filter>Advanced Filter. "Copy to another location" and "Unique records only" Filter on the number and street name to get jane smith 123 ...

Pivot Table Comment Field
I am wanting to put a comment field in a pivot table, so when some on sees something on the table they can put a comment as why it is there A free form type thing. I know that if I put a field in that is blan and it puts (blank) in all the cells in the field, if you change th word blank to what ever it changes all the same thing to what you typ in that field or cell. So the only thing I could think of was to pu numbers in the column prior to converting to a pivot table like 1-150 so they would all be unique so I can have a comment field. Is ther some other way to do this? Thanks for the help,...

Send as email greyed out
Hi, I am still unable to get an email merge to work. I've done everything I can to ensure that Outlook 07 is my default mail client (and it is). I've also added the "send as email" button to my MS Word tool bar. However, this is greyed out, which makes me think there is something not quite right in my setup. I looked at this page: http://help.lockergnome.com/office/Word-2007-greyed--ftopict938539.html and they refer to a registry addition - would it be a good idea to try this in Vista Business? Grateful for advice as I can't get mailouts to go till this is sorted. Tha...

Human Resource Module
My company needs to historically track position terminations and pay grades associated with positions. Is it possible to add two fields (Date1 and POSITIONCODE_I) to the table HR2EMP02? I haven't been able to find out and we really need a solution soon. Any and all help is greatly appreciated. you would need to use a custom user defined table to achieve that. Most likely, you would need a dexterity customization. Regards HS "CintiSnowblind" <CintiSnowblind@discussions.microsoft.com> wrote in message news:DE0C0246-3BD7-47BB-8513-F8C1706606F3@microsoft.com... > M...

description from dimension fields needed in purchase order/item li
We originally did not attach sub descriptions on our matrix/part number because of the way the price tags would read on our merchandise. It is alot cleaner looking to have a simple description and then in the fields below to show size and color. So, it really should not be necessary to attach the dimensions to the part number. As you know with the character limitations this does not give good information anyway. So, what we really need is for the dimension fields to show in seperate colums both when we look at items and when we create purchase orders. Not having the ability to do this i...

Contact relationship field should be longer than 10 characters
Forces clients to use slang-style truncations like grandpa instead of grandfather and Sis-in-law instead of sister in law. Workaround shown in tech knowledge article 867415 requires too much complex programming for a simple change in program functionality. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click &qu...

Identify fields in subroutine call
I wish to perform the same operation using each of several fields in the same database. A common subroutine would seem to be the best approach. I don't know how to pass the identification of the field to the subroutine. Something like: call subroutinex <field_identifier> ------------.. private subroutinex (<field_identifier> as <I don't know> dim field_identifier as <I don't know> <open the database containing the field> .. <perform actions based on the contents of that field>.. end sub ----------------------- I tried dimentioning the field...

Displaying a single field or two fields together
I have a chemical database that I'm working on, and in a report on each chemical, I would like it to display the contents of two fields, like this: Label: [field one] & [field two]. However, not all records have the second field. So I'd like for the ones with only field one used to just display: Label: [field one], but the ones with both to display as I've shown above. Is this possible? thanks! JJ JJ1109 wrote: > I have a chemical database that I'm working on, and in a report on each > chemical, I would like it to display the contents of two fields...

On 1099 what field is Withholdings?
Hello all. I am trying to determine what field in a payables transaction would show up to signify withholdings. I am first going to try and do it manually and then ultimatly create an integration for this. Does anyone know where in Dynamics Withholdings is placed in and shows up when 1099 reporting? Thanks all. Hi Sean, If you have setup a withholding vendor in the Company Setup Options window there will be a Subject to Withhold checkbox and percentage field in the Payables Transaction Entry window. You can view withholding amounts for your 1099 vendors by going to the Vendor P...

A calculated field in access
I need an Expression to extend the purchase date to a warranty expiration date based on a product type -- Thanks !Candy On Sun, 22 Nov 2009 20:35:01 -0800, Candy Pierce <candy083@hotmail.com> wrote: >I need an Expression to extend the purchase date to a warranty expiration >date based on a product type Ummmm.... How can we help? You have not chosen to post any information about the structure of your table, where the purchase date is stored, how you intend to identify the extension... Give us a hand here please? -- John W. Vinson [MVP] H...

Grey background
Hello, I copied a news article (using copy/paste) from the web into a Word .docx file. No problem. The word file text has a faint grey background that I want to remove before printing it. The grey background does not extend into the margins. I cannot find where on the menu system to remove it. Can you please point me in the right direction. Thanks KK Have you looked at Print Preview to see if the background color displays there? It's quite possible that it will only display but not print. If it shows in Print Preview it may very well be caused by either of seve...

Copy 2 fields from subform into new form
Hi, Really do not understand VBA. I want to copy the ID fields in a subform and paste them into a new form via a command button. Many thanks in advance Charlotte On Sat, 27 Feb 2010 16:22:01 -0800, Charlie <Charlie@discussions.microsoft.com> wrote: >Hi, > >Really do not understand VBA. I want to copy the ID fields in a subform and >paste them into a new form via a command button. > >Many thanks in advance > >Charlotte You'll have to give us a bit more context, I'm afraid! Are you working on the *design* of a form? or copyin...

Merge an alpha field and a numeric field
I would like to merge an alpha field with a numberic field. Not sure it this is possible. Thanks How do you want to merge them - put the 2 results into another cell? Then you can use =A1&B1 (assuming the alpha & numeric fields are in A1 & B1!) Do you mean Merge Cells? If 2 cells both contain data, then merging them will only keep the data in the upper left cell. Bob Umlas Excel MVP "grams" wrote: > I would like to merge an alpha field with a numberic field. Not sure it this > is possible. > > Thanks Try =concatenate(a1,b2) "grams" wrote:...

Updating data in fields
Hi, I have several thousand records in MS CRM (leads and accounts), which contain fields like annual turnover, number of employees etc. In 12 months time the information in such fields will be out of date and I need to be able to up date these fields from an external source so that we can continually target our marketing activity based on fields like turnover, number of employees etc. Can anyone tell me how I update individual fields for a record using data from an external source? Best regards Lee Hi Lee, Scribe Insight will do this. It has a DBLOOKUP function so that you can search fo...

Mail Options Greyed out
I installed Outlook (2003) last week and every thing worked fine. i have sent and received emils no problems. Today i can still receive emails ok, but i cannot send new / reply / forward - as these buttons are now greyed out ? Has anybody else come across this, if so how did you solve it. (if I do a test from set up email accounts that sends and receives the test ok) ...

Getting a form to "Grey Out" certain fields
I've got a table with about 20 fields in it. One of them is "Analysis Type". There are 6 different types to choose from. I've already got a form in my self-created switchboard that has 6 command buttons of each analysis type, enabling the user to choose. From there, I'd like to go to the data entry form (based of fields in the table). Where my question lies, is is it possible to have this form, once an analysis type is chosen, to "grey out" and lock certain fields on the data entry form that are not pertinant to that analysis type...so that the user cannot ...

Field as column name.
Hi, My problem is that I have the following two tables (tblParticipants and tblOrganisationWorkshops). The layout of tblParticipants looks like this: [ParticipantID] [Name] 1 Jantje 2 Anneke 3 Mieke 4 Thomaske And tblOrganistationWorkshops is made like this: [Id] [Participant] [Hour] [Workshop] 1 1 14 javascript 2 1 15 router 3 ...

Grey brackets & grey text
i am using Word 2003 and some of my text within a table has grey square brackets and greyed out text. i have turned off the "show bookmarks" setting but the grey is still there. i have also tried turning off the shading in Fields but this hasnt helped either. any ideas?? From your description, I'd guess what you are seeing are some form of fields. They could be form fields, whose shading you can show/hide by clicking the Form Field Shading button on the Forms toolbar. -- Stefan Blom Microsoft Word MVP "Manc Shaun" wrote: > i am using Wo...

no cells, grey screen, all tabs greyed out
I just opened my spreadsheet (xlsx file), no data or cells are present and all the tabs are greyed out. The screen (where cells/data s/b present) is just a grey blank screen. On the very top where the file name s/b in the border, it just says Microsoft Excel. What has happened? Can I recover my data? You need to open a workbook file (the Office icon is not greyed out) or start a new (use shortcut CTRL+N) best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "John" <John@discussions.microsoft.com> wrote in message news:0FDC...