text area pre filled if check box is on

  • Thread starter Thread starter ryddogop
  • Start date Start date
R

ryddogop

Hey


I have a form with a text area where users can submit there comment.
In the form I also have a check box, and when tis is on the text area
should be pre filled with a text. The text area should till be able to
edit before submit.

How do I make this possible?

Thanks for your suggestion.


Ryd.
 
You may have to describe what you want a little better. As it stands now it
could be that when you check the CheckBox, you fill the Text area with words
from the dictionary. Where do you expect the text to come from?
 
Hey


I have a form with a text area where users can submit there comment.
In the form I also have a check box, and when tis is on the text area
should be pre filled with a text. The text area should till be able to
edit before submit.

How do I make this possible?

You can use some VBA code in the Afterupdate event of the checkbox like:

Private Sub chkMyCheckbox_AfterUpdate()
If Me.chkMyCheckbox = True Then
Me.txtComments = "blah blah blah, the stuff you want it to say"
End If
End Sub

Note that this will blindly overwrite any existing comment; if you want
already entered comments left alone use

If Me.chkMyCheckbox = True And IsNull(Me.txtComments) Then


John W. Vinson [MVP]
 
You can use some VBA code in the Afterupdate event of the checkbox like:

Private Sub chkMyCheckbox_AfterUpdate()
If Me.chkMyCheckbox = True Then
Me.txtComments = "blah blah blah, the stuff you want it to say"
End If
End Sub

Note that this will blindly overwrite any existing comment; if you want
already entered comments left alone use

If Me.chkMyCheckbox = True And IsNull(Me.txtComments) Then

John W. Vinson [MVP]




Hey John

Many thanks for your help.

Ryd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top