View Full Version : DCOUNT Problem In Report


sysop470
07-05-2005, 07:28 PM
Hi,

I want to find DUPLICATE Vehicle registration no with any Vehicle colour in a report but unfortuantly its not working. They are all remaing black as forecolor even if there are duplicates.Any help pls.


MY CODE IS:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If DCount("vehicle reg no", "VEHICLE", "[Vehicle colour]" = "") > 0 Then
Me![Vehicle Reg No].ForeColor = 255
Else
Me![Vehicle Reg No].ForeColor = 0
End If
End Sub

Thanks
Andrew

WayneRyan
07-06-2005, 04:40 PM
sysop,

Duplicates should really be handled long before report generation, but ...


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If DCount("[vehicle reg no]", "VEHICLE", "[vehicle reg no] = '" & Me.[vehicle reg no] & "'") > 0 Then
Me![Vehicle Reg No].ForeColor = 255
Else
Me![Vehicle Reg No].ForeColor = 0
End If
End Sub


Wayne

sysop470
07-07-2005, 12:52 AM
Thanks, but it does not work, all the VEHICLE REG NO came red even those that are not duplicate.

Andrew

WayneRyan
07-07-2005, 12:22 PM
Andrew,

Can you post a sample?

Tools --> Database Utilities --> Compact/Repair,
Then ZIP into a file,
Then attach.

Wayne

sysop470
07-11-2005, 04:12 AM
@WayneRyan

For the serial no use 12345.

Sample database attached.

Thanks