Solved

Access Continous Form - Highlight change of "Product Code"

Posted on 2011-02-14
3
307 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 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Email question 19 93
How To Overlay Combo Box Row Source Type 'Value List' From VBA 2 52
Want my table columns to autofit. 7 63
office 2016 license quastion 3 45
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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 …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

739 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