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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|