PC Review


Reply
Thread Tools Rate Thread

Data Validation

 
 
LC
Guest
Posts: n/a
 
      9th Feb 2011
Hi,

I've been dealing with the following problem:

1) Users generates monthly information in Excel with the following
format

Volume Table
==========
Product Jan Feb Mar
SKU1 10 0 30
SKU2 5 7 20
SKU3 0 0 5

Price Table
========
Product Jan Feb Mar
SKU1 0.3 0.3 0.3
SKU2 0.5 0.0 0.7
SKU3 0.0 0.1 0.1

I want them to enter this information (using copy and paste) in an
Access Form in order to multiply Volume table x Price Table.

Before calculating the revenue, the access form must validate the
following conditions:

a. Validate that the SKU exists in Master Data (done)
a. If there's volume, there should be price. (e.g SKU2, in Feb has 7
in volume but 0 in price; this is an error
b If volume is zero, price is not required. (assume that Nulls are
not accepted)
c. paint which are the fields with problems

I think the best option is to change the format and work with
transposed volume and prices tables to perform the validation.

Volume Table
Product Month Volume_Amt

Price Table
Product Month Price_Amt

and query that information on Product and Month Fields.

I''ve seen this kind of validation in a VB Form with a Grid Control,
but can it be performed only with MS Access?

Regards,

LC





 
Reply With Quote
 
 
 
 
John Spencer
Guest
Posts: n/a
 
      10th Feb 2011
Yes, and it should be fairly easy to do with the normalized structure you are
proposing.

SELECT Volume.Product, Volume.Month, Volume_Amt, Price_Amount
, IIF(Price_Amt = 0 or Price_Amt is Null AND Volume_Amt > 0,"Invalid Price")
as ErrorMessage
FROM Volume LEFT JOIN Price
ON Volume.Product = Price.Product
AND Volume.Month = Price.Month

'Add a where clause if you want to return only records with problems
WHERE (Volume_Amt <> 0 and Volume_Amt is not Null)
AND (Price_Amt = 0 or Price_Amt is Null)



John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

On 2/9/2011 2:56 PM, LC wrote:
> Hi,
>
> I've been dealing with the following problem:
>
> 1) Users generates monthly information in Excel with the following
> format
>
> Volume Table
> ==========
> Product Jan Feb Mar
> SKU1 10 0 30
> SKU2 5 7 20
> SKU3 0 0 5
>
> Price Table
> ========
> Product Jan Feb Mar
> SKU1 0.3 0.3 0.3
> SKU2 0.5 0.0 0.7
> SKU3 0.0 0.1 0.1
>
> I want them to enter this information (using copy and paste) in an
> Access Form in order to multiply Volume table x Price Table.
>
> Before calculating the revenue, the access form must validate the
> following conditions:
>
> a. Validate that the SKU exists in Master Data (done)
> a. If there's volume, there should be price. (e.g SKU2, in Feb has 7
> in volume but 0 in price; this is an error
> b If volume is zero, price is not required. (assume that Nulls are
> not accepted)
> c. paint which are the fields with problems
>
> I think the best option is to change the format and work with
> transposed volume and prices tables to perform the validation.
>
> Volume Table
> Product Month Volume_Amt
>
> Price Table
> Product Month Price_Amt
>
> and query that information on Product and Month Fields.
>
> I''ve seen this kind of validation in a VB Form with a Grid Control,
> but can it be performed only with MS Access?
>
> Regards,
>
> LC
>
>
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom data validation on cells with data validation values AKrobbins Microsoft Excel Worksheet Functions 2 21st Jun 2011 04:20 PM
Data Validation -> Validation list is larger than the cell width Barb Reinhardt Microsoft Excel Programming 1 4th Mar 2010 08:24 PM
Crazy Data Validation ... List Validation Not Working TW Bake Microsoft Excel Programming 1 29th Mar 2007 02:41 AM
data validation invalid in dynamic validation list ilia Microsoft Excel Programming 0 7th Nov 2006 12:54 PM
When pasting data into a column with data validation I lose validation check Brad Microsoft Excel Misc 5 17th Apr 2004 01:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:38 AM.