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  dBforums > PC based Database Applications > Microsoft Access > .Text and .Value property of Text Box

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-11-12, 02:21
murthyspd murthyspd is offline
Registered User
 
Join Date: Jun 2005
Posts: 2
.Text and .Value property of Text Box

Hi,
I have a question. What's the difference between the .Text and .Value property of a text box.

I have a text box on a form and am displaying a Memo field from a table using the following statement

txt6Rs.SetFocus
txt6Rs.Text= !CR_Notes

The data in the field is 2k characters long.

It gives me an error "The setting for this property is too long". When I use .Value, I do not get that error. What is the difference between the two ?
Reply With Quote
  #2 (permalink)  
Old 01-11-12, 05:04
Sinndho Sinndho is offline
Registered User
 
Join Date: Mar 2009
Posts: 3,446
For a difference between both properties, see:
Text Property [Access 2003 VBA Language Reference]
Value Property [Access 2003 VBA Language Reference]

Is there a special reason why you need to use the Text property to assign a value to the control?
__________________
Have a nice day!
Reply With Quote
  #3 (permalink)  
Old 01-11-12, 10:58
Missinglinq Missinglinq is offline
Registered User
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 1,702
Sinndho's given you the links to the definitions.

From a practical standpoint, in Access VBA, Text is seldom used, the rare exception being in code in the OnChange event of a Textbox, to determine how many characters have been entered, when this is needed, such as when alerting the user to how many characters are left for use. As you already know, it require that Focus currently be on the Textbox.

The Value Property is used for basically everything else, from reading the data currently in the Control's underlying Field to assigning data to the same.

Since the Value Property is the Default Property for Textboxes, in code it can be omitted. So

Me.TextboxName.Value

can simply be written as

Me.TextboxName

Linq ;0)>
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2000/2003
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On