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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Editable field only based on another field



 
 
Thread Tools Display Modes
  #1  
Old September 25th, 2008, 03:12 PM posted to microsoft.public.access.tablesdbdesign
julostarr
external usenet poster
 
Posts: 45
Default Editable field only based on another field

Is there a way to make one field only editable based on the answer (like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then that makes
another field unavailable to edit, but if you check Yes then that field is
open to edit or instead of a Yes/No it is another data type and you are
required to enter something in order for another field to become editable.
--
julostarr
  #2  
Old September 25th, 2008, 09:54 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Editable field only based on another field

You could add something like the following to the AfterUpdate event of your
Yes/No checkbox control:

Me!YourOtherField.Enabled = Me!YourCheckbox


Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to make one field only editable based on the answer (like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then that makes
another field unavailable to edit, but if you check Yes then that field is
open to edit or instead of a Yes/No it is another data type and you are
required to enter something in order for another field to become editable.
--
julostarr



  #3  
Old September 25th, 2008, 10:44 PM posted to microsoft.public.access.tablesdbdesign
julostarr
external usenet poster
 
Posts: 45
Default Editable field only based on another field

Do I use this in the table, a form or query?
--
julostarr


"Jeff Boyce" wrote:

You could add something like the following to the AfterUpdate event of your
Yes/No checkbox control:

Me!YourOtherField.Enabled = Me!YourCheckbox


Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to make one field only editable based on the answer (like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then that makes
another field unavailable to edit, but if you check Yes then that field is
open to edit or instead of a Yes/No it is another data type and you are
required to enter something in order for another field to become editable.
--
julostarr




  #4  
Old September 26th, 2008, 12:39 AM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Editable field only based on another field

Access is not a "spreadsheet on steroids". You would not add this to a
table, which has no events, but to a form, which does.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Do I use this in the table, a form or query?
--
julostarr


"Jeff Boyce" wrote:

You could add something like the following to the AfterUpdate event of
your
Yes/No checkbox control:

Me!YourOtherField.Enabled = Me!YourCheckbox


Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to make one field only editable based on the answer
(like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then that
makes
another field unavailable to edit, but if you check Yes then that field
is
open to edit or instead of a Yes/No it is another data type and you are
required to enter something in order for another field to become
editable.
--
julostarr






  #5  
Old September 26th, 2008, 04:00 PM posted to microsoft.public.access.tablesdbdesign
julostarr
external usenet poster
 
Posts: 45
Default Editable field only based on another field

Well I figured that, but I'm just making sure that there wasn't some way that
I didn't know about. I already tried to put this in a form in the
AfterUpdate in my checkbox control properties. After returning to datasheet
view if I click the checkbox (on or off) I get the following message box:

"The expression After Update you entered as the event property setting
produced the following error: The object doesn't contain the Automation
object 'Benefits.'.

"*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro."

This is what I put in the After Update field according to your suggestion,
but I used the expression builder in my check box properties window to help
build it:

=Benefits![401(k)%].Enabled=Benefits![401(k)Participant]

Is there something I entered wrong? This also didn't stop the other field
from being editable regardless if the check box was checked or not.
--
julostarr


"Jeff Boyce" wrote:

Access is not a "spreadsheet on steroids". You would not add this to a
table, which has no events, but to a form, which does.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Do I use this in the table, a form or query?
--
julostarr


"Jeff Boyce" wrote:

You could add something like the following to the AfterUpdate event of
your
Yes/No checkbox control:

Me!YourOtherField.Enabled = Me!YourCheckbox


Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to make one field only editable based on the answer
(like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then that
makes
another field unavailable to edit, but if you check Yes then that field
is
open to edit or instead of a Yes/No it is another data type and you are
required to enter something in order for another field to become
editable.
--
julostarr






  #6  
Old September 26th, 2008, 04:29 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Editable field only based on another field

The error message suggests that Access doesn't have an "automation object"
named "Benefits" ... and I'm pretty sure it doesn't!

Are you trying to refer to a value on a form? If so, check the proper
syntax via Access HELP on 'expressions'. I believe it's something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP


"julostarr" wrote in message
...
Well I figured that, but I'm just making sure that there wasn't some way
that
I didn't know about. I already tried to put this in a form in the
AfterUpdate in my checkbox control properties. After returning to
datasheet
view if I click the checkbox (on or off) I get the following message box:

"The expression After Update you entered as the event property setting
produced the following error: The object doesn't contain the Automation
object 'Benefits.'.

"*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro."

This is what I put in the After Update field according to your suggestion,
but I used the expression builder in my check box properties window to
help
build it:

=Benefits![401(k)%].Enabled=Benefits![401(k)Participant]

Is there something I entered wrong? This also didn't stop the other field
from being editable regardless if the check box was checked or not.
--
julostarr


"Jeff Boyce" wrote:

Access is not a "spreadsheet on steroids". You would not add this to a
table, which has no events, but to a form, which does.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Do I use this in the table, a form or query?
--
julostarr


"Jeff Boyce" wrote:

You could add something like the following to the AfterUpdate event of
your
Yes/No checkbox control:

Me!YourOtherField.Enabled = Me!YourCheckbox


Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to make one field only editable based on the answer
(like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then that
makes
another field unavailable to edit, but if you check Yes then that
field
is
open to edit or instead of a Yes/No it is another data type and you
are
required to enter something in order for another field to become
editable.
--
julostarr








  #7  
Old September 26th, 2008, 05:34 PM posted to microsoft.public.access.tablesdbdesign
julostarr
external usenet poster
 
Posts: 45
Default Editable field only based on another field

I was thinking maybe their might be a conditional expression or IFF function
I could write that would tell my form if mycheckbox was checked yes then
allow editing on another field and if it is checked no then not to allow
editing. I am not sure where to put that or exactly what content to put in
it to construct that expression.
--
julostarr


"Jeff Boyce" wrote:

The error message suggests that Access doesn't have an "automation object"
named "Benefits" ... and I'm pretty sure it doesn't!

Are you trying to refer to a value on a form? If so, check the proper
syntax via Access HELP on 'expressions'. I believe it's something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP


"julostarr" wrote in message
...
Well I figured that, but I'm just making sure that there wasn't some way
that
I didn't know about. I already tried to put this in a form in the
AfterUpdate in my checkbox control properties. After returning to
datasheet
view if I click the checkbox (on or off) I get the following message box:

"The expression After Update you entered as the event property setting
produced the following error: The object doesn't contain the Automation
object 'Benefits.'.

"*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro."

This is what I put in the After Update field according to your suggestion,
but I used the expression builder in my check box properties window to
help
build it:

=Benefits![401(k)%].Enabled=Benefits![401(k)Participant]

Is there something I entered wrong? This also didn't stop the other field
from being editable regardless if the check box was checked or not.
--
julostarr


"Jeff Boyce" wrote:

Access is not a "spreadsheet on steroids". You would not add this to a
table, which has no events, but to a form, which does.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Do I use this in the table, a form or query?
--
julostarr


"Jeff Boyce" wrote:

You could add something like the following to the AfterUpdate event of
your
Yes/No checkbox control:

Me!YourOtherField.Enabled = Me!YourCheckbox


Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to make one field only editable based on the answer
(like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then that
makes
another field unavailable to edit, but if you check Yes then that
field
is
open to edit or instead of a Yes/No it is another data type and you
are
required to enter something in order for another field to become
editable.
--
julostarr









  #8  
Old September 26th, 2008, 06:47 PM posted to microsoft.public.access.tablesdbdesign
julostarr
external usenet poster
 
Posts: 45
Default Editable field only based on another field

Is there a way to build an IIF function that would essentially say for
example that "If [401(k)Participant] = Yes then make this make this
[401(k)Percent] editable else make it uneditable' and add it to the After
Update in the control properties box?
--
julostarr


"Jeff Boyce" wrote:

The error message suggests that Access doesn't have an "automation object"
named "Benefits" ... and I'm pretty sure it doesn't!

Are you trying to refer to a value on a form? If so, check the proper
syntax via Access HELP on 'expressions'. I believe it's something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP


"julostarr" wrote in message
...
Well I figured that, but I'm just making sure that there wasn't some way
that
I didn't know about. I already tried to put this in a form in the
AfterUpdate in my checkbox control properties. After returning to
datasheet
view if I click the checkbox (on or off) I get the following message box:

"The expression After Update you entered as the event property setting
produced the following error: The object doesn't contain the Automation
object 'Benefits.'.

"*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or macro."

This is what I put in the After Update field according to your suggestion,
but I used the expression builder in my check box properties window to
help
build it:

=Benefits![401(k)%].Enabled=Benefits![401(k)Participant]

Is there something I entered wrong? This also didn't stop the other field
from being editable regardless if the check box was checked or not.
--
julostarr


"Jeff Boyce" wrote:

Access is not a "spreadsheet on steroids". You would not add this to a
table, which has no events, but to a form, which does.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Do I use this in the table, a form or query?
--
julostarr


"Jeff Boyce" wrote:

You could add something like the following to the AfterUpdate event of
your
Yes/No checkbox control:

Me!YourOtherField.Enabled = Me!YourCheckbox


Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to make one field only editable based on the answer
(like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then that
makes
another field unavailable to edit, but if you check Yes then that
field
is
open to edit or instead of a Yes/No it is another data type and you
are
required to enter something in order for another field to become
editable.
--
julostarr









  #9  
Old September 26th, 2008, 07:05 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Editable field only based on another field

While you might use an IIF() function in a query (or an IF ... THEN...
statement in a function), I don't believe either is necessary.

If I wanted to enable a textbox based on whether a checkbox were checked,
I'd probably add something like the following in the checkbox's AfterUpdate
event:

Me!TextBox.Enabled = Me!Checkbox

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to build an IIF function that would essentially say for
example that "If [401(k)Participant] = Yes then make this make this
[401(k)Percent] editable else make it uneditable' and add it to the After
Update in the control properties box?
--
julostarr


"Jeff Boyce" wrote:

The error message suggests that Access doesn't have an "automation
object"
named "Benefits" ... and I'm pretty sure it doesn't!

Are you trying to refer to a value on a form? If so, check the proper
syntax via Access HELP on 'expressions'. I believe it's something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP


"julostarr" wrote in message
...
Well I figured that, but I'm just making sure that there wasn't some
way
that
I didn't know about. I already tried to put this in a form in the
AfterUpdate in my checkbox control properties. After returning to
datasheet
view if I click the checkbox (on or off) I get the following message
box:

"The expression After Update you entered as the event property setting
produced the following error: The object doesn't contain the Automation
object 'Benefits.'.

"*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error evaluating the function, event, or
macro."

This is what I put in the After Update field according to your
suggestion,
but I used the expression builder in my check box properties window to
help
build it:

=Benefits![401(k)%].Enabled=Benefits![401(k)Participant]

Is there something I entered wrong? This also didn't stop the other
field
from being editable regardless if the check box was checked or not.
--
julostarr


"Jeff Boyce" wrote:

Access is not a "spreadsheet on steroids". You would not add this to
a
table, which has no events, but to a form, which does.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Do I use this in the table, a form or query?
--
julostarr


"Jeff Boyce" wrote:

You could add something like the following to the AfterUpdate event
of
your
Yes/No checkbox control:

Me!YourOtherField.Enabled = Me!YourCheckbox


Regards

Jeff Boyce
Microsoft Office/Access MVP

"julostarr" wrote in message
...
Is there a way to make one field only editable based on the
answer
(like a
Yes/No checkbox) or entry of another field?

For example if you have a Yes/No checkbox and you check No then
that
makes
another field unavailable to edit, but if you check Yes then that
field
is
open to edit or instead of a Yes/No it is another data type and
you
are
required to enter something in order for another field to become
editable.
--
julostarr











  #10  
Old September 26th, 2008, 07:55 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Editable field only based on another field

On Fri, 26 Sep 2008 11:05:41 -0700, "Jeff Boyce"
wrote:

If I wanted to enable a textbox based on whether a checkbox were checked,
I'd probably add something like the following in the checkbox's AfterUpdate
event:

Me!TextBox.Enabled = Me!Checkbox


.... and also the Form's Current event, to handle existing records, I'd
suggest.
--

John W. Vinson [MVP]
 




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 12:35 PM.


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