Results 1 to 6 of 6
  1. #1
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84

    Conditional formatting: Expression Builder : max. number characters :-S

    Dear,

    I have an expression I need to use to apply conditional formatting.

    The Expression is:

    Day([lblDay0].[Caption]) & "/" & Month([lblDay0].[Caption])=Day(DLookUp("[Klantenbestand].[Geboortedatum]";"[Klantenbestand]";"[Klantenbestand].[Naam kind]='" & [Forms]![Bezetting komende 7 dagen]![Naam_kind] & "'" & " AND [Klantenbestand].[Voornaam kind]='" & [Forms]![Bezetting komende 7 dagen]![Voornaam_kind] & "'")) & "/" & Month(DLookUp("[Klantenbestand].[Geboortedatum]";"[Klantenbestand]";"[Klantenbestand].[Naam kind]='" & [Forms]![Bezetting komende 7 dagen]![Naam_kind] & "'" & " AND [Klantenbestand].[Voornaam kind]='" & [Forms]![Bezetting komende 7 dagen]![Voornaam_kind] & "'"))

    However, the Expression Builder does not allow me to copy/paste the whole formula, due to ??? max number of characters? If so, does anyone know a workaround? The conditional formatting must color the background color of a textbox in case the condition is met.

    Thank you in advance.
    Kind regards,


    Bart

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    DONT use Dlookup in a query. The query does this by joining to lookup tables.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    I would put the calculation as an addtional field in the form recordsource query - it will return either true or false. Then your expression becomes

    [calcfield]=true

  4. #4
    FL0XN0X is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Location
    Belgium
    Posts
    84
    the Expression below is working in my subform (with name [Bezetting komende 7 dagen]).

    DLookUp("[Klantenbestand].[Geboortedatum]";"[Klantenbestand]";"[Klantenbestand].[Naam kind]='" & [Forms]![Bezetting komende 7 dagen]![Naam_kind] & "'" & " AND [Klantenbestand].[Voornaam kind]='" & [Forms]![Bezetting komende 7 dagen]![Voornaam_kind] & "'")

    What is the correct syntax to use it from within a mainform? (naam mainform = [Overzicht capaciteit])

  5. #5
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    See if this info from Allen Browne helps: http://allenbrowne.com/casu-04.html
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  6. #6
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You should also remove ANY and ALL spaces in object names..... for example [Forms]![Bezetting komende 7 dagen]![Voornaam_kind]; there are spaces in the form name.

    Then you have [Klantenbestand].[Voornaam kind]='" & [Forms]![Bezetting komende 7 dagen]![Voornaam_kind] & "'"))
    In [Klantenbestand].[Voornaam kind], [Voornaam kind] does NOT have an underscore, but in other places in the query, [Voornaam_kind] DOES have an underscore.
    Should check on that.....

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

Similar Threads

  1. Replies: 1
    Last Post: 12-29-2017, 04:08 PM
  2. Conditional formatting expression
    By SunTop in forum Forms
    Replies: 3
    Last Post: 11-08-2016, 09:21 AM
  3. Replies: 6
    Last Post: 08-30-2016, 05:43 AM
  4. Access Form Conditional Formatting Expression
    By mrmmickle1 in forum Programming
    Replies: 1
    Last Post: 08-03-2016, 02:01 PM
  5. conditional formatting expression
    By kroenc17 in forum Programming
    Replies: 2
    Last Post: 10-22-2010, 09:53 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