Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing row from Flexgrid

Status
Not open for further replies.

JasonV

MIS
Jun 9, 1999
10
0
0
US
I'm using VB6 and taking data from a database using recordsets and placing the data in a flexgrid. For example, I have 3 columns in it...class, grade, date. A person could have taken the same class multiple times. These occurences are in the database. What I'd like to do is place only the latest date, grade and class of a specific class in the grid. ANy ideas???
 
your best bet is to pick up a book on SQL. You need to use some functions of SQL to select that data. You can dynamically set the recordset of a data control which allows you to customize the recordset using SQL. In other words using SQL allows you to select records from the database where certain criteria are met. You are currently selecting all the records which is why you see the duplicates. An SQL statement looks like this:<br>
<br>
"select * from stats where studentID = '524-42-9587'"<br>
<br>
using this statement your record set would contain only the records that have a Student ID or 524-42-9587. It isn't that hard to incorporate SQL statements into VB. I recommend these 2 books both published by Sams Publishing<br>
in 21 days<br>
1) Teach Yoursel Database Programming wiht Visual Basic 5 <br>
<br>
2) Teach Yourself SQL in 21 days
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top