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

Displaying data in VB (URGENT)

14
Expand|Select|Wrap|Line Numbers
  1. dim Str1(0 to 5) as string
  2. for i = 1 to 10
  3.     str1(i)= Me.controls("textbox" & i). text
  4. next
Is there a way of reversing this? as in:

Expand|Select|Wrap|Line Numbers
  1. dim Str1(0 to 5) as string
  2. for i = 1 to 10
  3.     Me.controls("textbox" & i). text = str1(i)
  4. next
(This code doesnt work, apperently it is read only)

I would also like to use : .Hide() and .Show() in the same way

(Using VB 2008 express)
Feb 15 '08 #1
3 912
jamesd0142
469 256MB
I asume you want to set the value of each text box to the value in the array?

such as
textbox1.text = str1(1)
textbox2.text = str1(2)

????

if so this works for me:
Expand|Select|Wrap|Line Numbers
  1.         Dim i As Integer
  2.         Dim Str1(0 To 5) As String
  3.         Str1(0) = 0
  4.         Str1(1) = 1
  5.         Str1(2) = 2
  6.         Str1(3) = 3
  7.         Str1(4) = 4
  8.         Str1(5) = 5
  9.  
  10.         For i = 1 To 5
  11.             Me.Controls("textbox" & i).Text = Str1(i)
  12.         Next
  13.  
Feb 15 '08 #2
Baladin
14
hmmm... it didnt work last time, but does now?!?, maybe i spelt something wrong, ah well thanks anyway
Feb 15 '08 #3
kadghar
1,295 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. dim Str1(0 to 5) as string
  2. for i = 1 to 10
  3.     str1(i)= Me.controls("textbox" & i). text
  4. next
Is there a way of reversing this? as in:

Expand|Select|Wrap|Line Numbers
  1. dim Str1(0 to 5) as string
  2. for i = 1 to 10
  3.     Me.controls("textbox" & i). text = str1(i)
  4. next
(This code doesnt work, apperently it is read only)

I would also like to use : .Hide() and .Show() in the same way

(Using VB 2008 express)
Your FOR should go from 0 to 5, otherwise you'll have a runtime error, since there's no Str1(6). You're leaving an space between the dot and the Text property, which by the way IS NOT read only (i dont think that's any problem). So i'd say changing the ranges will do. Otherwise, i'd say is a VB2008 express issue.

Kad [haven't checked the 2008 xpress yet u.u ]
Feb 15 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Robert | last post by:
Hello Accessors I have some reports created in Access that are very good for what they do. However, it seems to me that when you are displaying information you don't need to print out that a...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
1
by: kamkoum | last post by:
Hello, I am using readxml to retrieve data from an xml file to a dataset. m xml file has hierarchical data (2 levels) so the dataset will contain tables. My question : I need to display...
20
by: Tim Reynolds | last post by:
Team, I am developing a web service. In testing in on my enw PC, I am expecting to see exceptions thrown appear on my browser. Instead I am getting an HTTP 500 Internal Server Error page and I am...
5
by: shakthi | last post by:
Hi all, Am new to MFC appilcation programming.Plese tell me how to display a file with its path that is chosen from a file dialog.Am trying to create a dialog box displaying a list of...
17
sumittyagi
by: sumittyagi | last post by:
Hi! everybody! I am facing one problem. How to get data from response, where content type is image/jpg ore image/gif. normally browser do it for us, when it encounters an image tag, it sends an...
14
by: Brad | last post by:
I have a .net 2.0 web application project that creates a pdf file, saves the pdf to disk (crystal reports does this part), and then my code reads the pdf file and writes it to the httpresponse ...
2
by: Dawnyy | last post by:
I'm in desperate need of knowing how I can bind my data grid so that I have the following Customer ID - parent table Customer Name - parent table Status ID - parent table Status Description -...
1
by: sabbbih | last post by:
Hello All, i am new programmer in perl. i have following situation. i have a table in html page with two cols, I need to display the list of XML files stored in particular directory in col1 and when...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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?
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:
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...

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.