473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

I can't set Text property for a TextBox control to a string???

MLH
This property is only available only when the control has the focus...
Error #2185

I get the above error when code running in FormA is
trying to set the value of a hidden textbox on FormB
to a string. Here's the code I'm running. How can I
accomplish what I'm trying to do?

Forms!FormB!MyTextBox.Text = "Hello"
Nov 12 '05 #1
5 6789
"MLH" <CR**@NorthState.net> wrote in message
news:rd********************************@4ax.com...
This property is only available only when the control has the focus...
Error #2185

I get the above error when code running in FormA is
trying to set the value of a hidden textbox on FormB
to a string. Here's the code I'm running. How can I
accomplish what I'm trying to do?

Forms!FormB!MyTextBox.Text = "Hello"


The Text property is what you would use in VB. In Access you use the Value property.
Nov 12 '05 #2
MLH
On Wed, 24 Sep 2003 11:49:56 -0500, "Rick Brandt" <RB*****@Hunter.Com>
wrote:
"MLH" <CR**@NorthState.net> wrote in message
news:rd********************************@4ax.com.. .
This property is only available only when the control has the focus...
Error #2185

I get the above error when code running in FormA is
trying to set the value of a hidden textbox on FormB
to a string. Here's the code I'm running. How can I
accomplish what I'm trying to do?

Forms!FormB!MyTextBox.Text = "Hello"


The Text property is what you would use in VB. In Access you use the Value property.

Thx for the input, Rick. Here's what I came up with. It
works - except for when the string I'm trying to assign
is over 2048 chars long. I have VLS (very long strings)
to deal with and am now going to have to go BACK to
the drawing board on this. Suggestions?

Forms!FormB!MyTextBox.ControlSource = "=" & Chr$(34) & VLS & Chr$(34)
Nov 12 '05 #3
"MLH" <CR**@NorthState.net> wrote in message
news:t2********************************@4ax.com...
On Wed, 24 Sep 2003 11:49:56 -0500, "Rick Brandt" <RB*****@Hunter.Com>
wrote:
"MLH" <CR**@NorthState.net> wrote in message
news:rd********************************@4ax.com.. .
This property is only available only when the control has the focus...
Error #2185

I get the above error when code running in FormA is
trying to set the value of a hidden textbox on FormB
to a string. Here's the code I'm running. How can I
accomplish what I'm trying to do?

Forms!FormB!MyTextBox.Text = "Hello"
The Text property is what you would use in VB. In Access you use the Value

property. Thx for the input, Rick. Here's what I came up with. It
works - except for when the string I'm trying to assign
is over 2048 chars long. I have VLS (very long strings)
to deal with and am now going to have to go BACK to
the drawing board on this. Suggestions?

Forms!FormB!MyTextBox.ControlSource = "=" & Chr$(34) & VLS & Chr$(34)


I don't understand the problem. A TextBox can hold just about as much text as you
want to jam into it. I believe the limit is around 64,000 characters from the GUI
and even higher than that when done programmatically.

If the TextBox is bound to a character field in the underlying table, then you will
have a limit of 255 characters. In that case you need to change the field type to
Memo.
Nov 12 '05 #4
"Rick Brandt" <RB*****@Hunter.Com> wrote in message
news:bk************@ID-98015.news.uni-> >
Forms!FormB!MyTextBox.ControlSource = "=" & Chr$(34) & VLS & Chr$(34)


I don't understand the problem. A TextBox can hold just about as much text as you
want to jam into it. I believe the limit is around 64,000 characters from the GUI
and even higher than that when done programmatically.

If the TextBox is bound to a character field in the underlying table, then you will
have a limit of 255 characters. In that case you need to change the field type to
Memo.


In looking at this again I see you are attempting to set the ControlSource property
which does have a length limit. Why are you doing that? Just use...

Forms!FormB!MyTextBox = VLS

The Value property being the default, it does not need to be explicitly qualified.
Nov 12 '05 #5
MLH
>In looking at this again I see you are attempting to set the ControlSource property
which does have a length limit. Why are you doing that? Just use...

Forms!FormB!MyTextBox = VLS

The Value property being the default, it does not need to be explicitly qualified.

Sorry about the confusion. FormA was opening FormB in A_DIALOG
WindowMode which was halting code running in FormA. I had to close
FormB because processing was locked at that time. When FormB closed,
processing in FormA resumed with the next statement and that's where
the procedure was attempting to write the VLS to the control - only
the form was no longer in form view and I was getting an error. Had
nothing to do with writing VLS to textbox. Sorry.
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dx | last post by:
I'm extremely frustrated with ASP.NET...again! To me this should be as simple as setting oCheckBox.Checked = True.. yet for some reason it isn't. I have a user control (ascx) that that has a...
3
by: vtxr1300 | last post by:
I'm trying to create a login box control to use that simply exposes the username, password and remember me properties when the login button is clicked. I have the button click wired up and working...
0
by: stevenhaochen | last post by:
I add a user control (a simple textbox control) to customize datagridview column to test how to add user control to datagridview. I found a weired behavior. I can not input "q", "!", "#". But I...
31
by: Kathy | last post by:
I would like to get the old and new value for a change made to a text box so that I can store them in a change history table. What is the best way to do this? I am just learning VB 2005; porting...
10
by: Miro | last post by:
I wanted certain text boxes ( only certain ones ) to always be Trim'd so that spaces are not in the begining, nor the end of the text entered. I created my own "Handle ?" - i hope thats the...
3
by: dmbuso | last post by:
I have a money field defined in a SQL Server 05 database with a value of 49.50. Also, it displays in SQL Server as 49.5000. I have a form in VB.NET 2005 and I'm using the new MaskedTextBox control...
12
by: Marc | last post by:
Hi, How can i increase the mousehover event timer? AddHandler NewBtn.MouseHover, AddressOf Shownotes Private Sub Shownotes(ByVal sender As System.Object, ByVal e As System.EventArgs)...
1
by: =?Utf-8?B?Tmltcm9kIFJvdG5lcg==?= | last post by:
Hi, I built a web control wich has text box and public property that set or get the text value of that text box. when i try to access that property i got error: "Object reference not set to an...
1
by: sivakrishna546 | last post by:
using System; using System.Collections; using System.ComponentModel; using System.Security.Permissions; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.