?
Solved

Choosing only data that is available - Excel

Posted on 2006-10-29
3
Medium Priority
?
188 Views
Last Modified: 2010-04-30
Hello

I am working on a ordering process and trying to automate it.  I will give you an example of what I am trying to do below.

When I receive orders for some of my products I place the order in an Excel spreadsheet (address, order #, qty of each product).  For each order, it is placed in one row, so if I have an order going to John Smith and he orders 3 out of the 20 products that I have to offer these are all inserted in the same row.  From there I run a mail merge in Word to generate a packing list/invoice.  What I am looking to do is make it so only the products that are ordered show up on the invoice without specifying a specific place on the Word template for each product.  

Is there a Macro that I could use to make this happen?

Please let me know if you need more info.

Best Regards
wdelaney
0
Comment
Question by:wdelaney05
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 17831153
Hi wdelaney05,

I would recommend you rethink the way this works.  From your description, it shounds like each product
occupies a different column.  From a data modeling perspective, this is a bad choice.

In my opinion, you will be far better off in the long run by using a database app instead.  Access actually
comes delivered with a simple order entry template that I suspect will handle your needs with just a little
tweaking.

Regards,

Patrick
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 1500 total points
ID: 17832667
However, Word mailmerge is not designed to work with the one-to-many query that would be necessary to join the customer details to the order details, so you would have to use Access reporting. There's nothing wrong with that in the long run, but you would have to familiarise yourself with quite a lot.

Meanwhile...

Presumably you have a very limited number of products.

You could make each item only show if the quantity is greater than 0. This requires your MAILMERGE fields to be nested inside IF fields. It would be best to show the field codes (Alt+F9 toggles on and off). Do not type the {} pairs in, either enter them with Ctrl+F9 or as part of a field insertion.

{ IF { MAILMERGE "qtyA" } > 0 { MAILMERGE "ProductA" } "" }                 { IF { MAILMERGE "qtyA" } > 0 { MAILMERGE "qtyA"} "" }
{ IF { MAILMERGE "qtyB" } > 0 { MAILMERGE "ProductB" } "" }                 { IF { MAILMERGE "qtyB" } > 0 { MAILMERGE "qtyB"} "" }  

In Word 2000, you get an option to supress any blank lines that might result. In Word 2003 it's done without asking.

 
0
 

Author Comment

by:wdelaney05
ID: 17838154
Thanks you two for the answers.  I agree with you on the Access database.  That is something I need to do some more research on to utilize.  

Best Regards,
wdelaney05
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question