Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Word, PowerPoint, Outlook, and Other Office Products > VBA code help


Reply
 
Thread Tools Display Modes
  #1  
Old 07-23-2003, 06:38 AM
TomG TomG is offline
Freshman
 
Join Date: Jul 2003
Posts: 48
Post 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
Reply With Quote
  #2  
Old 07-23-2003, 07:29 AM
Mandelbrot's Avatar
Mandelbrot Mandelbrot is offline
Senior Contributor
 
Join Date: Apr 2002
Location: glbTheWorld.Europe.UK
Posts: 1,201
Default

Just use an update query - not VBA.


Paul.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Standards and Practices loquin Tutors' Corner 10 07-28-2006 12:16 PM
delete VBA code when Project is protected? deneb Word, PowerPoint, Outlook, and Other Office Products 0 07-11-2003 03:28 AM
vb6 write vba code to word? AusNerd Word, PowerPoint, Outlook, and Other Office Products 0 06-03-2003 05:19 PM
VBA code generation shark182 Excel 1 05-22-2003 05:59 AM
Text formattting watkins General 16 04-23-2002 12:01 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->