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
|
|||
|
|||
Yes/No options linking to other Fields
Hi i was wondering if anybody can point me in the right direction.
I would like to know if there is anyway of using a yes/no box that when a user changes its state to 'Yes' (in a form) a text box will appear (in the same form) allowing ther user to enter the appropriate text. The text box does not have to be hidden (but it would be great if it could be grayed out), it just cannot allow text to be entered into it when the box is marked as 'No'. Adrian |
#2
|
|||
|
|||
Yes/No options linking to other Fields
On Sat, 25 Jul 2009 06:59:01 -0700, adrian007uk wrote:
Hi i was wondering if anybody can point me in the right direction. I would like to know if there is anyway of using a yes/no box that when a user changes its state to 'Yes' (in a form) a text box will appear (in the same form) allowing ther user to enter the appropriate text. The text box does not have to be hidden (but it would be great if it could be grayed out), it just cannot allow text to be entered into it when the box is marked as 'No'. Adrian Code the Check Box AfterUpdate event: Me.[OtherControl].Enabled = Me.[CheckBoxName] Place the same code in the Form's Current event. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
Yes/No options linking to other Fields
Private Sub chkWhatever_AfterUpdate()
If Me.chkWhatever = True Then ' Uncomment the 1 you want to happen ' Me.txtOther.Enabled = True ' MetxtOther.Visible = True Else ' Me.txtOther.Enabled = False ' MetxtOther.Visible = False End If End Sub If you want this to persist after you change records and/or re-open records you'll also need to call it in the form's Current event: Private Sub Form_Current() chkWhatever_AfterUpdate End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "adrian007uk" wrote in message ... Hi i was wondering if anybody can point me in the right direction. I would like to know if there is anyway of using a yes/no box that when a user changes its state to 'Yes' (in a form) a text box will appear (in the same form) allowing ther user to enter the appropriate text. The text box does not have to be hidden (but it would be great if it could be grayed out), it just cannot allow text to be entered into it when the box is marked as 'No'. Adrian |
#4
|
|||
|
|||
Yes/No options linking to other Fields
Hi fredg
Thanks, that worked great. "fredg" wrote: On Sat, 25 Jul 2009 06:59:01 -0700, adrian007uk wrote: Hi i was wondering if anybody can point me in the right direction. I would like to know if there is anyway of using a yes/no box that when a user changes its state to 'Yes' (in a form) a text box will appear (in the same form) allowing ther user to enter the appropriate text. The text box does not have to be hidden (but it would be great if it could be grayed out), it just cannot allow text to be entered into it when the box is marked as 'No'. Adrian Code the Check Box AfterUpdate event: Me.[OtherControl].Enabled = Me.[CheckBoxName] Place the same code in the Form's Current event. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#5
|
|||
|
|||
Yes/No options linking to other Fields
Thanks Arvin
I thought your code was complicated but i managed to get it to work. I can now use yours or fredg's answers as both work. Many thanks. Adrian "Arvin Meyer [MVP]" wrote: Private Sub chkWhatever_AfterUpdate() If Me.chkWhatever = True Then ' Uncomment the 1 you want to happen ' Me.txtOther.Enabled = True ' MetxtOther.Visible = True Else ' Me.txtOther.Enabled = False ' MetxtOther.Visible = False End If End Sub If you want this to persist after you change records and/or re-open records you'll also need to call it in the form's Current event: Private Sub Form_Current() chkWhatever_AfterUpdate End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "adrian007uk" wrote in message ... Hi i was wondering if anybody can point me in the right direction. I would like to know if there is anyway of using a yes/no box that when a user changes its state to 'Yes' (in a form) a text box will appear (in the same form) allowing ther user to enter the appropriate text. The text box does not have to be hidden (but it would be great if it could be grayed out), it just cannot allow text to be entered into it when the box is marked as 'No'. Adrian |
Thread Tools | |
Display Modes | |
|
|