Results 1 to 10 of 10
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486

    notification via query in continuous form

    I am looking to add a notification field or conditional formatting in a continuous form that is based on underlying data or data from a query. I have a continuous form where each line is a summary of multiple lines. I need a way to determine if any of the lines that make up the summary have a different code in it.

    For example the summary line is composed of five detailed lines. In each detailed line there is a field called rcode. Most of the rcodes will be 1 but sometimes it will have a 6. I need a way to set up some field or color notification in the summary line if any of the underlying rcodes are a 6.

    I am not sure how to do this but I was thinking of running a query that returns a result if any of the rcode fields is a six and a different result if none of them are six. OR maybe a DLookup could do it.



    Does anyone have an idea for this?
    Thanks

  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I'm not understanding what you are trying to do.
    Maybe you would post a copy of your dB with records to demonstrate the problem?

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    An expression like IsRCOde6:If(dCount("*","tblDetails","[rcode]=6 AND [WhatEverFieldYouUseToSumarize]=" & [SumarizeID])>0,True,False) could work....
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486
    Sorry, I cant post the database, it is quite large and my boss wouldn't want me to so I will try to explain better.
    Click image for larger version. 

Name:	DB.png 
Views:	18 
Size:	105.9 KB 
ID:	43159

    I have included an image of what it looks like. In my continuous form, where the line items are derived from a totals query, I need a flag or indicator if any of the underlying line items for each total has an RC of 6.

    I will be trying the dcount method today, any other ideas is appreciated.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I suggest you mock up a sample database showing the issue with some representative data. Readers do not need your operational database nor real data. They need to see the issue in context to offer focused responses.
    Pick 1 or 2 situations, anonymize the data...

  6. #6
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486
    Ok, I will work on that. It will take me a bit of time so I will post back later. will the forum allow me to upload a DB?

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    How do you group in the totals query? Invoice#? You can do a similar totals query in which you group by invoice number and add in the criteria row RC=6 (use Where in the totals row to only return the invoice number). Name it qryInvoicesWithRC6 or something similar. Now simply do an outer join in your query that is the record source for the form you show and use a calculated field: HasRC6:IIF(IsNull([qryInvoicesWithRC6 ]![InvoiceNumber]),"NO","YES").

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  8. #8
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by tagteam View Post
    ..... will the forum allow me to upload a DB?
    Do a "Compact & Repair", then compress the dB (I use Winzip - you could use 7-Zip or the Win built in compress function).



    To attach files, see:
    Click image for larger version. 

Name:	Attach1.png 
Views:	16 
Size:	45.4 KB 
ID:	43163

  9. #9
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The image in Post #4 helped a little.
    So, you are using a Totals Query to get the invoice total amount.
    Referring to the image (Post#4), what field(s) are you using to group the records? (or what is the SQL of the totals query?)

    One method would be to write a UDF to check the records to determine if any rcode is equal to 6.

    Do you need to know how many records have an rcode = 6?

  10. #10
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you could have a separate summary in your totals query something like

    Code:
    SELECT InvNum, sum(sales) as Total, -sum(rCode=6) AS hasRCode
    FROM myTable
    GROUP BY InvNum
    then conditionally format based on the hasRCode value

Please reply to this thread with any new information or opinions.

Similar Threads

  1. giving notification to users on the form
    By shod90 in forum Forms
    Replies: 4
    Last Post: 03-24-2016, 08:07 AM
  2. Date Change Notification Query
    By McArthurGDM in forum Queries
    Replies: 20
    Last Post: 05-15-2015, 11:14 AM
  3. Replies: 2
    Last Post: 01-01-2014, 02:10 PM
  4. Query Update Criteria Continuous Form Row ID
    By andrebmsilva in forum Queries
    Replies: 2
    Last Post: 12-13-2012, 04:39 AM
  5. query notification
    By imintrouble in forum Queries
    Replies: 3
    Last Post: 01-18-2012, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums