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  

Yes/No options linking to other Fields



 
 
Thread Tools Display Modes
  #1  
Old July 25th, 2009, 02:59 PM posted to microsoft.public.access.gettingstarted
adrian007uk
external usenet poster
 
Posts: 67
Default 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  
Old July 25th, 2009, 04:12 PM posted to microsoft.public.access.gettingstarted
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old July 25th, 2009, 04:19 PM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default 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  
Old July 26th, 2009, 07:08 PM posted to microsoft.public.access.gettingstarted
adrian007uk
external usenet poster
 
Posts: 67
Default 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  
Old July 26th, 2009, 07:10 PM posted to microsoft.public.access.gettingstarted
adrian007uk
external usenet poster
 
Posts: 67
Default 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

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 07:31 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.