Solved

Access Continous Form - Highlight change of "Product Code"

Posted on 2011-02-14
3
313 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
[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 85

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

630 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