473,624 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!MyT extBox.Text = "Hello"
Nov 12 '05 #1
5 6800
"MLH" <CR**@NorthStat e.net> wrote in message
news:rd******** *************** *********@4ax.c om...
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!MyT extBox.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**@NorthStat e.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!MyT extBox.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!MyT extBox.ControlS ource = "=" & Chr$(34) & VLS & Chr$(34)
Nov 12 '05 #3
"MLH" <CR**@NorthStat e.net> wrote in message
news:t2******** *************** *********@4ax.c om...
On Wed, 24 Sep 2003 11:49:56 -0500, "Rick Brandt" <RB*****@Hunter .Com>
wrote:
"MLH" <CR**@NorthStat e.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!MyT extBox.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!MyT extBox.ControlS ource = "=" & 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 programmaticall y.

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!MyT extBox.ControlS ource = "=" & 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 programmaticall y.

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!MyT extBox = 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!My TextBox = 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
4492
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 checkbox and I can't get it to default to checked. I tried radiobuttons and experienced the same result.. can't start them as checked. The really frustrating thing is that I set the attributes of other input controls in the Init() with no problem. ...
3
1964
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 and at one time, the username was holding state. I don't know what I changed, but now nothing holds state. I've read a number of messages about making sure that the controls are added to the control collection during CreateChildControls, which...
0
2510
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 can input other keys (e.g. "Q", "@", "W") Anybody found this question? It looks like the textbox eat the input 'q' and does not show up in the text. Public Class DataGridViewEditorButtonEditingControl Inherits TextBox
31
21802
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 an application from MS Access where I could just use the TextBox.OldValue construct. TIA, Kathy
10
1560
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 right terminology, and it works. Is this the right way to do this? I had to use DirectCast to get the textbox name. Private Sub TrimValues(ByVal sender As System.Object, ByVal e As EventArgs) _
3
9125
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 in Visual Studio. I set the Mask property for the text box to "$999.00". The problem is when I run the form the text box displays "$495.00" and not "$49.50" as one would expect. It it shifting the values left here. How do I fix this? Thanks...
12
3787
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) MsgBox("ttt") Thanks!!!
1
2213
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 instance of ..." the compilation has no detected problem and i do not understand what is the problem.
1
1376
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 Samples.AspNet.Controls.CS {
1
8341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8488
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7170
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.