468,301 Members | 1,478 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,301 developers. It's quick & easy.

Insert a table in a form

3
Hello, I use Visual Basic 6 to get some data from an Access database...

What I want to do, is create a table in my form to put that data inside. But I want to be able to access the table's cells individually (like excel). So I thought that I could put a simple table (not connected to a data source), put the data in an array and then, with a loop, put them in the table. The problem is that i can't find a proper kind of table... So can anyone help me?

Thanks in advance!
Nov 26 '06 #1
4 5229
mousi
3
Oh... What I forgot to say is that I want the user to be able to edit the data in the cells.... I tried doing that with MSFlexGrid, but i cannot find a property to let the user edit the table values!
Nov 27 '06 #2
Killer42
8,434 Expert 8TB
Oh... What I forgot to say is that I want the user to be able to edit the data in the cells.... I tried doing that with MSFlexGrid, but i cannot find a property to let the user edit the table values!
I think you'll save yourself a lot of problems if you get the terminology straight. It's a grid, not a "table".

I think you can use at least one of the various grid controls to edit your "local" data, but don't remember which one(s). If I can find it, I do have some code which provides a workaround for the old Grid control by positioning a text box over the cell you want to edit. It works fairly well, if you can't find a better way.

The DBgrid control can work in "unbound" mode to edit data which doesn't come from a database table, but I don't recall how to work with it.
Nov 27 '06 #3
mousi
3
Thanks for your answer killer... I've found the ubgrid grid control which does what I want. The truth is that it's not the best I could use but it's ok... Oh and another short question:
I want to open a file for reading and writing, so i use the textstream method. Is this a good method to use or should I use something else? The file I want to read (and write) is small (2-3 lines)
Nov 28 '06 #4
Killer42
8,434 Expert 8TB
I want to open a file for reading and writing, so i use the textstream method. Is this a good method to use or should I use something else? The file I want to read (and write) is small (2-3 lines)
To be honest, I have no idea. I've never used a TextStream - tend to just use a simple Open statement. For example, to read three lines from a file, I'd normally use something like
Expand|Select|Wrap|Line Numbers
  1. Open "TheFile.txt" For Input Access Read Shared As #1
  2.   Line Input #1, Var1
  3.   Line Input #1, Var2
  4.   Line Input #1, Var3
  5. Close #1
I suppose I find it very simple, because I've used similar statements in lots of BASIC versions over the years. But whether it's the best way to do it, I really couldn't say.
Nov 28 '06 #5

Post your reply

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

Similar topics

2 posts views Thread by newbie_mw | last post: by
2 posts views Thread by Geoffrey KRETZ | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.