By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

Insert a table in a form

P: 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
Share this Question
Share on Google+
4 Replies


P: 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

Expert 5K+
P: 8,434
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

P: 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

Expert 5K+
P: 8,434
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.