Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Do Until rs.EOF 'This piece does not allow the TO to repeat. If the TO is repeated, then it will just move to the next record until it finds one that does not repeat If rs!TO = TheTO Then 'Same with the STO. Keeps the STO from repeating. If the STO is a duplicate, it goes to the next one. If rs!STO = TheSTOname Then 'If the staff name duplicates, then it goes to the next record. THIS IS A PROBLEM. I need the staff names to repeat with the STOs If TheStaffName = rs!TeamName Then 'If the ActDesc repeats, it will move to the next line. If theActDesc = rs!ActDesc Then rs.MoveNext Else 'Starts writing the ActDesc to the spreadsheet theRow = theRow + 1 oSheet.Cells(theRow, 4).Value = rs!ActDesc rs.MoveNext End If Else 'Starts moving the staff names to the spreasheet. I want these connected to the sto name. theRow = theRow + 1 oSheet.Cells(theRow, 3).Value = rs!TeamName TheStaffName = rs!TeamName rs.MoveNext End If Else theRow = theRow + 1 oSheet.Cells(theRow, 2).Value = rs!STO TheSTOname = rs!STO rs.MoveNext End If Else theRow = theRow + 1 oSheet.Cells(theRow, 1).Value = rs!TO TheTO = rs!TO rs.MoveNext End If skip: Loop
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|access query - field that substitutes characters||1||26|
|Access Report formatting issue||5||24|
|MS Office 2016 Home & Business, Access Runtime 2013, on Citrix?||6||17|