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
|
|
|
|
Reply
|
Utf
|
1/10/2008 9:18:00 AM |
|
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
|
|
|
|
Reply
|
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
|
|
|
|
Reply
|
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
|
|
|
|
Reply
|
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
|
|
|
|
Reply
|
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
|
|
|
|
Reply
|
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
|
|
|
|
Reply
|
Utf
|
1/10/2008 4:20:01 PM
|
|
|
6 Replies
257 Views
(page loaded in 1.598 seconds)
Similiar Articles: Getting a form to "Grey Out" certain fields - microsoft ...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... Grey brackets & grey text - microsoft.public.word ...i am using Word 2003 and some of my text within a table has grey square brackets and greyed out ... is still there. i have also tried turning off the shading in Fields ... grey text box - microsoft.public.word.docmanagementI want to display the Cost Centre in a text box on a ... To grey out a command ... box on the form [tbName] text field ... an unbound ... display the value of an unbound ... How to get rid of pop-up question boxes (form fields) in Word 2007 ...How to get rid of pop-up question boxes (form fields) in Word 2007 ... Removing gray shading in ... forms 17 How do I grey out a button ... Remove field shading when ... Prevent data entry if another field contains data - microsoft ...Trying to "Grey Out" unwanted fields in a data entry form ... data entry form for each analysis type. For ... need 5 fields filled, out, while another ... or controls on a ... How Write New Field Data From Form Entry Into A Separate Table ...Trying to "Grey Out" unwanted fields in a data entry form Follow... as this entry is ... to check that the user entered data into the Remarks field ... ... the old and ... Lock pages in memory greyed out - microsoft.public.sqlserver ...Getting a form to "Grey Out" certain fields - microsoft ..... it possible to have this form, once an analysis type is chosen, to "grey out" and lock ... to that type ... Data analysis by 2-dimensional data table + database - microsoft ...Trying to "Grey Out" unwanted fields in a data entry ..... depending on the choice of Analysis Type, the table ... to calculate volume? - database.itags.org Trying to ... Removing tables while preserving content - microsoft.public.word ...Trying to "Grey Out" unwanted fields in a data entry ... I have a table with about 20 fields, one of them being ... types might > only need 5 fields filled, out, while ... checkbox control greyed out on some records FollowIf you check you will find they have a Null value. I imagine the field was added after those records were added or those records were appended as Null. Disabling (graying-out) Form Fields - Acrobat User CommunityDisabling, or graying-out, form fields is a common feature in software applications, but is somehow missing from Acrobat and LiveCycle forms. About the closest you ... Graying out fields at scroll-level 1 - Toolbox for IT GroupsHi, We've 3 fields at scroll level1 - 1 from a primary record and 2 from a derived record. We've a requirement wherein we need to gray out ... grey out subforms until main form fields entered? - Access World ...Microsoft Access Discussion > Forms ... I have a MS Access 2003 app pointing to a SQL Server database. The main form has two ... Ok, I've almost answered this ... Grey Out Text & Date Fields With A Combo Box - Microsoft AnswersHi, I wanted to grey out text boxes and date boxes if a combo box (called "Agency_Name") hasn't been filled in with anything that is listed. I can only get it to work ... Grey out text field - Dev Shed - Dev Shed Forums - Open Source web ...Grey out text field- JavaScript Development. Visit Dev Shed to discuss Grey out text field 7/17/2012 6:58:45 PM
|