Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access Continous Form - Highlight change of "Product Code"

Posted on 2011-02-14
3
Medium Priority
?
315 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 1000 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 1000 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

715 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