Solved

Access Continous Form - Highlight change of "Product Code"

Posted on 2011-02-14
3
269 Views
Last Modified: 2012-05-11
I have 4000 records displayed in a continuous form.

Each record shows a "Product" and a selling price and "Check Price" flag.   The user will review hundreds of records on tghe screen and occasionally click on the "Check Price" flag.

The form shows the data in product sequence.
Each product can occur MULTIPLE times.

Question: This question applied to continous forms in general.  Is there anyway I can highlight when the "Product Code" changes.
0
Comment
Question by:Patrick O'Dea
3 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 34889485
Access can't really track the "previous" record using conditional formatting, so I don't see how you'd do this. In order to highlight when the Product Code changes, you'd somehow have to know what the previous value was, and that's not something that is available for CF.

0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 250 total points
ID: 34889767
There are a couple of approaches but they are not easy..

There is no concept of Previous or Next in Access queries so you have to use record key values to get the record with the next lower value (for previous) or next higher value(for next).
This means that PROVIDED the records have a unique key and are sequenced on that key then you can find the previous record value and you can then utilise conditional formatting to highlight each new number.
However this sort sequence usually means that other like values (Product in this case) are NOT adjacent and so the technique can't be used.
 
Alternatively you can write a function that uses a recordset with the same sql as your form, which should therefore be in the same sequence as your form, and for each record you can use Moveprevious and/or Movenext commands to see if the previous/next record was for the same product.  This will always work provided you have an unambiguously defined record sequence - it would be entirely hit and miss if the sort order could produce different results and still be correct.   So if you sort only on Productid and there can be several records with the same productid you cannot predict the sequence of records within each productid  - so you must use another sort field to force each set of the same productid into a definite and reproduceable sequence.  If you don't do this then the record sequence in the form might be different to the record sequence in the function's recordset.
The function can return a 'Same' or 'Different' result and you can then use conditional formatting to highlight the values.
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 34890796
Thanks all,

In particular peter57r .... I will try your suggestions later.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now