Hi, i've got the following code that allows me to to have a database field display in the reports "Group Header", and also fields in the details.
The problem is, it's not actually grouping all EquipmentTypes (ie: (None)) together, and listing the details below it. Belows a picture of how it's doing it (TOP) compared how it should look (BOTTOM)
I guess it wouldn't hurt if I explained a little bit more on what i'm looking for. Say theres 4 Equipment IDs. Each of these EquipmentIDs are connected to an EquipmentType (in the DB, theres a row with Type = (None), ID = 12, Details = blah blah blah. Another row has Type = (None), ID = 12, Details = Blah Blah Blah. When I run the report, since these share the same Type, they look like the below where it mentions (None). Now in yet another row, I have a Type = Dryer, ID = 13, Details = blah blah...and another row has Type = Dryer, ID = 14, Details = Blah Blah Blah...since these share the same Type, They are listed below the EquipmentType group, but since their ID is different, they are shown one level down as the second example below shows.
EquipmentType: (None)
EquipmentID: 12
Details...Details...Details...Details.... **this rows has an equipmentid of 12**
EquipmentID: 12
Details...Details...Details...Details....**This ones equipmentid is 12 too**
--------------------------------------
EquipmentType: Dryer
EquipmentID: 13
Details...Details....Details....Details....**This rows EquipmentID is 13**
--------------------------------------
EquipmentID: 14
Details...Details....Details....Details....**This ones is 14**
Code:
strSQL = "SHAPE {"
strSQL = strSQL & "SELECT * "
strSQL = strSQL & "FROM tblMaintenanceRequests "
strSQL = strSQL & "WHERE DateInitiated "
strSQL = strSQL & "BETWEEN #" & strTo & "# "
strSQL = strSQL & "AND #" & strFrom & "# "
strSQL = strSQL & "ORDER BY EquipmentType} "
strSQL = strSQL & "AS Command1 "
strSQL = strSQL & "APPEND ({ "
strSQL = strSQL & "SELECT * "
strSQL = strSQL & "FROM tblMaintenanceRequests} "
strSQL = strSQL & "AS Command2 RELATE 'MaintenanceRequestID' "
strSQL = strSQL & "TO 'MaintenanceRequestID') AS Command2 "
The problem is, it's not actually grouping all EquipmentTypes (ie: (None)) together, and listing the details below it. Belows a picture of how it's doing it (TOP) compared how it should look (BOTTOM)

I guess it wouldn't hurt if I explained a little bit more on what i'm looking for. Say theres 4 Equipment IDs. Each of these EquipmentIDs are connected to an EquipmentType (in the DB, theres a row with Type = (None), ID = 12, Details = blah blah blah. Another row has Type = (None), ID = 12, Details = Blah Blah Blah. When I run the report, since these share the same Type, they look like the below where it mentions (None). Now in yet another row, I have a Type = Dryer, ID = 13, Details = blah blah...and another row has Type = Dryer, ID = 14, Details = Blah Blah Blah...since these share the same Type, They are listed below the EquipmentType group, but since their ID is different, they are shown one level down as the second example below shows.
EquipmentType: (None)
EquipmentID: 12
Details...Details...Details...Details.... **this rows has an equipmentid of 12**
EquipmentID: 12
Details...Details...Details...Details....**This ones equipmentid is 12 too**
--------------------------------------
EquipmentType: Dryer
EquipmentID: 13
Details...Details....Details....Details....**This rows EquipmentID is 13**
--------------------------------------
EquipmentID: 14
Details...Details....Details....Details....**This ones is 14**