Click here to Skip to main content
15,895,084 members

Flexgrid data display problem in VB6

Rajesh Kainikkara asked:

Open original thread
Hi Experts
I have an MS Access table Sale, it has several rows of invoice data like this


Date InvNO Product Rate Qty
01/04/12 001 abc 10 5
01/04/12 001 pqr 12 7
01/04/12 001 xyz 11 3
01/04/12 002 abc 10 5
01/04/12 002 pqr 12 7
01/04/12 003 xyz 11 3
01/04/12 003 abc 10 5
01/04/12 004 pqr 12 7
01/04/12 005 xyz 11 3


I want to display the invoce data in a flexgid1 when i type the invoice no in txtinvno

after the connection string I wrote the code like this
set rs = New ADODB.Recordset
rs.open "select date,invNo,Product,Rate,qty from sale where rs.fields(1)=txtinvno.text",conn
index=1
for i =rs.recordcount()
flexgrid1.textmatrix(index,0)=rs.fields(2)
flexgrid1.textmatrix(index,1)=rs.fields(3)
flexgrid1.textmatrix(index,2)=rs.fields(4)
index=index+1
rs.movenext
next i

The code works but its show only records in first row only.I think the looping I given is incorrect.I am not a programmer but a hobbiest please correct the code.

Regards
Rajesh
Tags: Visual Basic 6

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900