Sabtu, 19 Desember 2015

Re: [MS_AccessPros] Re: Continuous form -- row colors

 

Steve-


Did you create and save qryPODistinct?

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Dec 19, 2015, at 4:36 PM, Steve5 thaw5@suddenlink.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

John,

I added the new field to the form's underlying query. When I attempt to view the modified query in Datasheet, it wants a parameter entered for qryPODistinct. I'm assuming it should not be asking for a parameter input. Advice?

Steve

On 12/19/2015 5:14 AM, John Viescas JohnV@msn.com [MS_Access_Professionals] wrote:
 

Steve-


Create a query like this:

qryPODistinct:
SELECT DISTINCT PONumber FROM PurchaseOrders;

Then add a column to the Record Source of your form:

POSeq: (SELECT COUNT(*) FROM qryPODistinct WHERE qryPODistinct <= [PONumber])

That should add a sequence number to each of the PO Numbers.  Use POSeq in Conditional Formatting to display white when the POSeq is odd, and Gray when it is even.

Expression: [POSeq] Mod 2 = 0

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)



On Dec 18, 2015, at 10:55 PM, Steve5 thaw5@suddenlink.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:

No. The continuous form displays rows of the items associated with each of the many purchase orders. As I look at the screen, I'd like to see a band of gray rows for PO #1. And then a band of white rows for PO #2. And then a band of gray rows for PO #4 (PO #3 is missing). And so on, alternating bands of white and gray delineating the items associated with each PO. No clicking involved, just scrolling.

The objective is for the user to be able to scroll the screen and see the items associated with a given PO visually differentiated from the PO before and the PO after.

Thank you, Steve

On 12/18/2015 3:44 PM, wrmosca@comcast.net [MS_Access_Professionals] wrote:
 

Steve


Let me give an example and you tell me if I understand you right.

You click on a purchase order number.
All associated rows become gray
You click on another PO
The previous rows return to normal and the newly selected PO has its associated rows turn gray.

Is the above right?

-Bill


---In MS_Access_Professionals@yahoogroups.com, <thaw5@suddenlink.net> wrote :

Hi Bill,

My goal is to gray the rows associated with every other purchase order. While the recordset is sorted by purchase order ascending, there are randomly missing purchase order numbers. So, to answer your question, a change of purchase order number should gray the rows associated with that purchase order. And the next change of purchase order number should stop graying the rows associated with it.

Steve

On 12/18/2015 11:52 AM, wrmosca@comcast.net [MS_Access_Professionals] wrote:
 

Steve - What determines which row should be gray? Conditional Formatting would be the way to go for this as long as you have something that earmarks a record as needing to be gray.


Regards,
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP
My nothing-to-do-with-Access blog

 


---In MS_Access_Professionals@yahoogroups.com, <thaw5@suddenlink.net> wrote :

I have a continuous form consisting of these fields: purchase order
number, item description, item quantity, item cost, date and other
fields. The underlying query is sorted by purchase order number
ascending. Each purchase order has a random number of items associated
with it. Some purchase order numbers are missing.

I'd like to set the background color to a light grey for every other
purchase order for all of the fields in the rows associated with that
purchase order. I have looped through a recordset and successfully
picked out the rows for which I want a light grey backcolor. I set the
FieldName.Backcolor property to the light grey color but I always end up
changing the backcolor of all of the rows. How do I restrict the
backcolor change to just the selected rows?

Steve





__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (13)

.

__,_._,___

Tidak ada komentar:

Posting Komentar