A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Greyout Fields



 
 
Thread Tools Display Modes
  #1  
Old May 10th, 2004, 12:47 PM
John
external usenet poster
 
Posts: n/a
Default Greyout Fields

Hello,
I am trying to create database for the first time, and
one of the things I need it to do is to hide or geayout
some of the fields dependant on a tick being places in
anouther field.
Dose anybody know how this can be done ???

If so Please Help

Thanks
John

  #2  
Old May 10th, 2004, 01:03 PM
Byron
external usenet poster
 
Posts: n/a
Default Greyout Fields

John,

We've all had that "first time."

I will assume that when you speak of a "tick" in another
field, that you are using either a checkbox or an option
button. In either case, you will need some code added to
the "AfterUpdate" event of your checkbox or option button
or, for that matter, what ever control you are using.

The "grey out" is refered to as disabled. So the control
is either enabled or disabled.

The code would be like:

to disable the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = False

to hide the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = True

HTH

Byron
-----Original Message-----
Hello,
I am trying to create database for the first time, and
one of the things I need it to do is to hide or geayout
some of the fields dependant on a tick being places in
anouther field.
Dose anybody know how this can be done ???

If so Please Help

Thanks
John

.

  #3  
Old May 10th, 2004, 03:47 PM
Bruce
external usenet poster
 
Posts: n/a
Default Greyout Fields

Am I missing something here, or should that part about
hiding the control be Visible = False?
To John, to add code to an event, double click the control
in Design View (or right click Properties if the form is
already selected). Click the Event tab, then click next
to After Update (it is After Update in this case, but
there are many places to put an event, depending on your
needs). Click the three dots, click Code Builder, click
OK, then enter the suggested code between the lines that
read "Private Sub ..." and "End Sub". Save, then go back
to your form and give it a try.
-----Original Message-----
John,

We've all had that "first time."

I will assume that when you speak of a "tick" in another
field, that you are using either a checkbox or an option
button. In either case, you will need some code added to
the "AfterUpdate" event of your checkbox or option button
or, for that matter, what ever control you are using.

The "grey out" is refered to as disabled. So the control
is either enabled or disabled.

The code would be like:

to disable the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = False

to hide the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = True

HTH

Byron
-----Original Message-----
Hello,
I am trying to create database for the first time, and
one of the things I need it to do is to hide or geayout
some of the fields dependant on a tick being places in
anouther field.
Dose anybody know how this can be done ???

If so Please Help

Thanks
John

.

.

  #4  
Old May 10th, 2004, 07:01 PM
Byron
external usenet poster
 
Posts: n/a
Default Greyout Fields

Bruce,

Oops, of course you are correct. Just a slip up.

Sorry.

By the way, great explantion.

Byron

-----Original Message-----
Am I missing something here, or should that part about
hiding the control be Visible = False?
To John, to add code to an event, double click the

control
in Design View (or right click Properties if the form

is
already selected). Click the Event tab, then click next
to After Update (it is After Update in this case, but
there are many places to put an event, depending on your
needs). Click the three dots, click Code Builder, click
OK, then enter the suggested code between the lines that
read "Private Sub ..." and "End Sub". Save, then go

back
to your form and give it a try.
-----Original Message-----
John,

We've all had that "first time."

I will assume that when you speak of a "tick" in

another
field, that you are using either a checkbox or an

option
button. In either case, you will need some code added

to
the "AfterUpdate" event of your checkbox or option

button
or, for that matter, what ever control you are using.

The "grey out" is refered to as disabled. So the

control
is either enabled or disabled.

The code would be like:

to disable the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = False

to hide the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = True

HTH

Byron
-----Original Message-----
Hello,
I am trying to create database for the first time,

and
one of the things I need it to do is to hide or

geayout
some of the fields dependant on a tick being places in
anouther field.
Dose anybody know how this can be done ???

If so Please Help

Thanks
John

.

.

.

  #5  
Old May 11th, 2004, 08:38 AM
John Green
external usenet poster
 
Posts: n/a
Default Greyout Fields

Thanks For your help
but how do I get the field to return to a disabled state
when the tick is removed say in the case of an error
-----Original Message-----
John,

We've all had that "first time."

I will assume that when you speak of a "tick" in another
field, that you are using either a checkbox or an option
button. In either case, you will need some code added to
the "AfterUpdate" event of your checkbox or option button
or, for that matter, what ever control you are using.

The "grey out" is refered to as disabled. So the control
is either enabled or disabled.

The code would be like:

to disable the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = False

to hide the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = True

HTH

Byron
-----Original Message-----
Hello,
I am trying to create database for the first time, and
one of the things I need it to do is to hide or geayout
some of the fields dependant on a tick being places in
anouther field.
Dose anybody know how this can be done ???

If so Please Help

Thanks
John

.

.

  #6  
Old May 11th, 2004, 03:50 PM
Byron
external usenet poster
 
Posts: n/a
Default Greyout Fields

John,

I don't think that I am clear about what you are wanting.
If you are wanting to attempt to prevent users from
accidentally unchecking the check box then you could
either present a message asking them if that really want
to uncheck the box. You might also consider disabling
the check box after it is checked to prevent it being
unchecked again. In this case you would first need to
prompt the user that they would not be able to uncheck
the box and if they agree, disable it. You would also
need to provide some method for being able to enable the
check box if it became absolutly necessary to uncheck it,
ike maybe creating a key combination that would enable
the checkbox. All of this would just make it more
difficult for users to mess it up.

Just a couple of ideas.

HTH

Byron

-----Original Message-----
Thanks For your help
but how do I get the field to return to a disabled state
when the tick is removed say in the case of an error
-----Original Message-----
John,

We've all had that "first time."

I will assume that when you speak of a "tick" in

another
field, that you are using either a checkbox or an

option
button. In either case, you will need some code added

to
the "AfterUpdate" event of your checkbox or option

button
or, for that matter, what ever control you are using.

The "grey out" is refered to as disabled. So the

control
is either enabled or disabled.

The code would be like:

to disable the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = False

to hide the control use:
Me.TheNameOfTheControlToBeDisabled.Enabled = True

HTH

Byron
-----Original Message-----
Hello,
I am trying to create database for the first time,

and
one of the things I need it to do is to hide or

geayout
some of the fields dependant on a tick being places in
anouther field.
Dose anybody know how this can be done ???

If so Please Help

Thanks
John

.

.

.

  #7  
Old May 11th, 2004, 08:06 PM
Corrina
external usenet poster
 
Posts: n/a
Default Greyout Fields

Just use "If" in the code to specify whether to disable/hide or enable/show the control. In a check box, the value of a check is -1 and no check (white) is 0. (If the check box is grey, it has a null value.) The visual basic code for the After Update Event would look something like this:

If [checkbox]=-1 Then
(code to enable/show)
ElseIf [checkbox]=0 Then
(code to disable/hide)
End If

Corrina Burnley
Burnley Data Solutions
www.burnleydatasolutions.com

----- John Green wrote: -----

Thanks For your help
but how do I get the field to return to a disabled state
when the tick is removed say in the case of an error
-----Original Message-----
John,
We've all had that "first time."
I will assume that when you speak of a "tick" in another

field, that you are using either a checkbox or an option
button. In either case, you will need some code added to
the "AfterUpdate" event of your checkbox or option button
or, for that matter, what ever control you are using.
The "grey out" is refered to as disabled. So the control

is either enabled or disabled.
The code would be like:
to disable the control use:

Me.TheNameOfTheControlToBeDisabled.Enabled = False
to hide the control use:

Me.TheNameOfTheControlToBeDisabled.Enabled = True
HTH
Byron
-----Original Message-----
Hello,
I am trying to create database for the first time, and
one of the things I need it to do is to hide or geayout
some of the fields dependant on a tick being places in
anouther field.
Dose anybody know how this can be done ???
If so Please Help
Thanks

John
.
.


 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.