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

Populating a text box based on a button



 
 
Thread Tools Display Modes
  #1  
Old April 30th, 2008, 03:26 PM posted to microsoft.public.access.forms
adf
external usenet poster
 
Posts: 1
Default Populating a text box based on a button

I have a form, I would like the user to be able to open a record and press a button on the form which would then "put" a predefined string into the "comments" field of that record, which is displayed as a text box.

I tried using comments.text = "This is my comment" in the Button's click event, but got an error stating that the textbox needed to have focus or something for this to work.

Any ideas?
  #2  
Old April 30th, 2008, 03:45 PM posted to microsoft.public.access.forms
Rockn
external usenet poster
 
Posts: 48
Default Populating a text box based on a button

Set the focus prior to entering the text.
Put
Me.Textboxname.SetFocus
Me.Textboxname.Text = "This is the Comment"

adf wrote in message ...
I have a form, I would like the user to be able to open a record and press
a button on the form which would then "put" a predefined string into the
"comments" field of that record, which is displayed as a text box.

I tried using comments.text = "This is my comment" in the Button's click
event, but got an error stating that the textbox needed to have focus or
something for this to work.

Any ideas?



 




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