
07-23-2003, 06:38 AM
|
|
Freshman
|
|
Join Date: Jul 2003
Posts: 48
|
|
VBA code help
|
Hi all,
I'm having trouble getting the result I'm after using VBA. I can't think of a simple way of completing the following. I can group the data using SQL in a recordset but not part 2.
I have a table that contains the following data.
EmpCode ExpenseType LedgerCode
PBEXPS Mileage 5001
PBEXPS Parking 5001
PBEXPS Phone - Internet 7502
PBEXPS Phone - Mobile 7507
PBEXPS Taxi 7400
PBEXPS Train 7400
TGEXPS Airfare 5006
TGEXPS Mileage 5006
TGEXPS Other 5007
TGEXPS Phone - Mobile 5007
TGEXPS Taxi 5006
TGEXPS Train 5006
I need to group on EmpCode and LedgerCode as below but enter the ExpenseType into the description field. So I end up with the following
EmpCode LedgerCode Description
PBEXPS 5001 Mileage, Parking
PBEXPS 7400 Taxi, Train
PBEXPS 7502 Phone – Internet,
PBEXPS 7507 Phone – Mobile
TGEXPS 5006 Mileage, Airfare, Taxi, Train
TGEXPS 5007 Phone – Mobile, Other
Any suggestions?
Cheers
Tom
|
|