Results 1 to 4 of 4
  1. #1
    JohnBoy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    43

    Award Customer Points based on sum of Columns

    Pretty new to this VBA stuff especially in Access, I can do the docmd stuff etc and some SQL but I have come up against a small problem I could use some help with,
    I have inherited a database which I am currently trying to bring some sense to and make more useful,


    I have a number of columns in a table relating to customers purchases and need to work out a way to award points per row of data,
    So lets say there are 16 columns,
    Col A has a customer ID recorded in it, say RA123456
    Col B has the main product class number say R123 recorded in it.
    The remaining columns have sub category reference number in them say A123 B123 C123 etc etc,
    I have a look up table that contains all of these categories etc and a points system that goes with them,
    What I want to do is have a new column (17) in my main table look at all of the reference numbers in the row and award a number of points to the row based on the sum of the look ups,
    Is this possible and if so any help would be gratefully received

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    The new colum will have a field which sums the appropriate columns, e.g.

    Column17 field is
    SumofColmuns: nz(A123) + nx(b123) + nz(b123) + ...

    Note that the NZ function is used on the column values to avoid adding a null value which would destroy the sum.

  3. #3
    JohnBoy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    43
    Many thanks I will give it a go and let you know how I get on

  4. #4
    JohnBoy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    43
    All working many thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. using VBA to freeze columns
    By bdaniel in forum Forms
    Replies: 1
    Last Post: 02-12-2010, 05:36 AM
  2. Columns in a Listbox
    By craigalaniz in forum Access
    Replies: 3
    Last Post: 01-07-2010, 01:11 PM
  3. Replies: 1
    Last Post: 08-19-2009, 01:14 AM
  4. Total based on Formula based on field value
    By cjbuechler in forum Reports
    Replies: 15
    Last Post: 07-10-2009, 09:56 AM
  5. Add Columns to query
    By 4petessake in forum Access
    Replies: 0
    Last Post: 06-15-2007, 01:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums