all groups > vb.net controls > october 2005 >
You're in the

vb.net controls

group:

Can someone please correct my statement ?



Can someone please correct my statement ? Mac
10/14/2005 9:11:53 AM
vb.net controls: VB6.


I selected records from SQL2K and saved into cursor.
Now I want to display on the screen by using MSFLEXGRID. I tried listbox
and I can see the data but I want it in msflexgrid.

I tried following statement but it just put part number and price in the
first column.

I want part number in first and price in second column like spreadsheet.

I would appreciate if someone please correct my statement.

Myform.MSFlexGrid1.AddItem rs!partno & Space(5) & rs!price

Thank you very much.


Re: Can someone please correct my statement ? Rick Rothstein [MVP - Visual Basic]
10/14/2005 12:23:13 PM
[quoted text, click to view]

Try this and see if it works...

Myform.MSFlexGrid1.AddItem rs!partno & vbTab & rs!price

Rick

Re: Can someone please correct my statement ? Someone
10/14/2005 2:43:01 PM
You could also try:

MSFlexGrid1.Row =1

MSFlexGrid1.Col =1
MSFlexGrid1.Text = rs!partno
MSFlexGrid1.Col =2
MSFlexGrid1.Text = rs!price



[quoted text, click to view]

Re: Can someone please correct my statement ? Rick Rothstein [MVP - Visual Basic]
10/14/2005 3:05:36 PM
[quoted text, click to view]

Actually, if you want to do it by separate cell entries, I like
using the TextMatrix property since that does not require you to
continually set and reset the Row and Col properties...

MSFlexGrid1.TextMatrix(1, 1) = rs!partno
MSFlexGrid1.TextMatrix(1, 2) = rs!price

The TextMatrix property also works very nicely in a loop.

Rick

Re: Can someone please correct my statement ? Jeff Johnson [MVP: VB]
10/14/2005 3:30:09 PM

[quoted text, click to view]

Then please don't crosspost to a .NET group.

Re: Can someone please correct my statement ? MikeD
10/14/2005 6:53:22 PM

[quoted text, click to view]


Also need to question posting to a Word newsgroup. What does this have to do
with Word? For that matter, I don't see where or how ADO comes into play
either.

Mac, what we're really telling you is that you need to choose the newsgroups
you post to a little more carefully. No newsgroup appreciates off-topic
posts. And trust me, regular newsgroup readers REMEMBER those who "abuse"
the newsgroups and may not offer help in the future....so....you're really
hurting yourself by posting to non-relevant newsgroups.

--
Mike
Microsoft MVP Visual Basic



RE: Can someone please correct my statement ? Amit Mohod
10/21/2005 12:18:04 AM
Try following code:

Myform.MSFlexGrid1.AddItem rs!partno & Char(9) & rs!price

Chr(9) is a Tab key code.

--
Amit Mohod
Nagpur, India


[quoted text, click to view]
AddThis Social Bookmark Button