ADO DBGrid Problem

M

manf442

I have a database with an employee table. There are duplicate ss#'s in this table

I want to create a recorset that shows the duplicate records.

In Access 2000 I created a SQL statement that did display what I wanted.

Below is SQL from access:

In (SELECT [EmployeeSSNumber] FROM [REmployee] As Tmp GROUP BY [EmployeeSSNumber] HAVING Count(*)>1 )


Then in VB 6 I created an ADO control with a DB Grid bound to it.

Below is the SQL statement for the Recordsource property:

(SELECT [EmployeeSSNumber] FROM [REmployee] As Tmp GROUP BY [EmployeeSSNumber] HAVING Count(*)>1 )

What happens is that the records are displyed in the DB grid, but it does not show all the records. Just the first of each duplicate.
 
A

Albert D. Kallal

it is possible that the grid control is keyed by some id, and has a setting
for duplicates. For most grids in ms-access, I use the built-in forms, and
if you look at the screen shots here, the results 99% of the time will
eliminate the need for a ActiveX grid control. Check these screen shots out:

http://www.attcanada.net/~kallal.msn/Articles/Grid.htm

You might want to ask your question in a VB6 group, and see what they
mention, as so few of us ms-access people use ActiveX grid controls when we
got such nice built in stuff as the above screen shots show.

Any possibility you can use continues forms, or multi-column listboxes in
place of your grid control? (it is way easier, less code, and does not
introduce activeX component distribution problems (since you now need to use
a installer..which you don't have).
 
B

Bob M.

Nice article on web site. To bad I need to use VB for my custom application
for client.
 
Top