473,395 Members | 1,516 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,395 software developers and data experts.

Output Textbox

I'm having trouble getting input from a textbox in Visual Basic 6.0

Private Sub cmdGetNumber_Click()
txtInput.Text = Str(Int(1000 * Rnd))
End Sub

The error message states: "Method or data member not found"

The properties window of the textbox has "txtInput" next to "Name"

In the coding window, when I type "txtInput.", a list of items
appears. The list does not contain "Text".

Why doesn't it work?
Jul 17 '05 #1
6 8526
> I'm having trouble getting input from a textbox in Visual Basic 6.0

Private Sub cmdGetNumber_Click()
txtInput.Text = Str(Int(1000 * Rnd))
End Sub

The error message states: "Method or data member not found"

The properties window of the textbox has "txtInput" next to "Name"

In the coding window, when I type "txtInput.", a list of items
appears. The list does not contain "Text".

Why doesn't it work?


Are you absolutely sure you placed a TextBox and not some other control
that looks like one (for example, a ListBox)? Check the text in the
drop-down box at the top of the Properties box. Highlight what you think
is a TextBox and see if the text in the drop-down says

txtInput TextBox

Out of curiosity, what are say the first 5 items listed when you type
the "dot" after "txtInput"?

Rick - MVP

Jul 17 '05 #2
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote:
Are you absolutely sure you placed a TextBox and not some other control
that looks like one (for example, a ListBox)?
I checked. It's definitely a textbox.

Out of curiosity, what are say the first 5 items listed when you type
the "dot" after "txtInput"?


That's the weird part. It only lists four items:
Count
Item
LBound
UBound

If I type "txtInput.Item.", I get a long list which contains "Text"

Do I need to fix something?

Private Sub cmdGetNumber_Click()
txtInput.Text = Str(Int(1000 * Rnd))
End Sub

The error message states: "Method or data member not found"

The properties window of the textbox has "txtInput" next to "Name"

In the coding window, when I type "txtInput.", a list of items
appears. The list does not contain "Text".

Jul 17 '05 #3
> > Are you absolutely sure you placed a TextBox and not some other
control
that looks like one (for example, a ListBox)?


I checked. It's definitely a textbox.

Out of curiosity, what are say the first 5 items listed when you type the "dot" after "txtInput"?

That's the weird part. It only lists four items:
Count
Item
LBound
UBound


The problem you are having is because your TextBox is part of a Control
Array of TextBoxes. Each member of the Control Array is an individual
TextBox, but to address their properties, you have to specify which
member of the Control Array you are addressing. You do that by including
the Index number of the TextBox whose properties you want to change. For
example, if the Index value of the TextBox you are trying to address is,
say, 2, then you would do this

txtInput(2).Text = "Whatever you are trying to assign"

Now, if none of the above makes any sense to you<g>, then I'll assume
you created the Control Array accidentally. If that is the case, then
simply highlight the TextBox in question and delete (in the Properties
box) whatever value is in its Index property. That will convert it back
to a normal TextBox which you can address in the manner you are used to.
If neither of the above covers your problem, post back here with more
information.

Rick - MVP

Jul 17 '05 #4
ka*****@mailinator.com (Karen) wrote in message news:<e0**************************@posting.google. com>...
<cut>
That's the weird part. It only lists four items:
Count
Item
LBound
UBound


<g>
you set the Index property of the textbox and turned it into a control
array; delete the value in the properties window for the Index and
things should start working the way you expect again.

Note that if you've created any event procedures they probably have an
initial parameter reading "Index As Integer" and you'll get errors
when you try to run that the event procedure doesn't match. Delete
that first Index parameter from the event. For exampe, change:
Private Sub Text1_Change(Index As Integer)
to:
Private Sub Text1_Change()

and
Private Sub Text1_Validate(Index As Integer, Cancel As Boolean)
to
Private Sub Text1_Validate(Cancel As Boolean)
Jul 17 '05 #5
Not sure you got an answer -
looks like you have a control array rather than a plain textbox
the textbox has an index property set to something rather than blank.
"Karen" <ka*****@mailinator.com> wrote in message
news:e0**************************@posting.google.c om...
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote:
Are you absolutely sure you placed a TextBox and not some other control
that looks like one (for example, a ListBox)?


I checked. It's definitely a textbox.

Out of curiosity, what are say the first 5 items listed when you type
the "dot" after "txtInput"?


That's the weird part. It only lists four items:
Count
Item
LBound
UBound

If I type "txtInput.Item.", I get a long list which contains "Text"

Do I need to fix something?

Private Sub cmdGetNumber_Click()
txtInput.Text = Str(Int(1000 * Rnd))
End Sub

The error message states: "Method or data member not found"

The properties window of the textbox has "txtInput" next to "Name"

In the coding window, when I type "txtInput.", a list of items
appears. The list does not contain "Text".

Jul 17 '05 #6
Bob Butler wrote:
delete the value in the properties window for the Index


That fixed it.

Thanks guys!

Karen
Jul 17 '05 #7

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

Similar topics

3
by: Brooke | last post by:
I am new to access, so please excuse ignorance. Within my table (contacts) I have a text field (other). What I am trying to do is collect all of the text input from the field 'other', separate each...
1
by: Adrian Constantinescu | last post by:
Hi, When a project VB.Net start, the output window if filled with this kind on informations: 'TextBox.exe': Loaded...
5
by: Markus S. | last post by:
Hello, I have a problem with a DOS EXE that is called by a .Net Winforms application. I need to redirect the console output into a textbox, but this should happen in real time, so when new...
1
by: AxOn | last post by:
Hi, I have a small dos program that compiles txt files. The dos program checks the text file, and if there's an error or if the text is ok it sends a message to the dos prompt. I would like to...
0
by: Luke Herbert | last post by:
I am very new to C# and have been trying to get to grips with it by writing a small tool to detect a USB key being inserted and then backup user specified files to the key. I have written some...
4
by: Sarah | last post by:
Hi - I am extremely new to programming so I apologize in advance for my lack of knowlege, vocabulary and if my code is sloppy. I will take any suggestions to clean up my code and to follow any...
1
by: Alexander Vasilevsky | last post by:
Help to develop wrapper for cmd.exe and to redirect all input and output in TextBox. -- http://www.alvas.net - Audio tools for C# and VB.Net developers
8
by: ehcy | last post by:
hello! i have a problem here will you please help me?.. this is my script <?php //$text = "Like '%american journal of med%'"; $text = $_POST; $sep = " ";
3
by: Wixxel | last post by:
Let my apologize upfront, i'm very new to C#. I have an array i want to iterate and output it to a textbox. Is a textbox the ideal control for the output of my array? If yes, any suggestion would be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.