Results 1 to 9 of 9
  1. #1
    Dimitris is offline Novice
    Windows 11 Access 2021
    Join Date
    Apr 2025
    Posts
    3

    Contitional formating in continuous forms with vba

    Hello to all, i have an issue with contitional formating in icontinuous forms .i want to change the font from Italic to strikethrough .The standard formating does not have this option so i tried with vba but it doesn't work properly.any suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Programmatically changing control property changes for ALL instances of control on form. Why do this on a form? Do it in a report with Detail section format event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Dimitris is offline Novice
    Windows 11 Access 2021
    Join Date
    Apr 2025
    Posts
    3
    June7,thanks for your replay ,but i have a list of materials showing on the forms and sometimes i want to cansel some of them with out deleting
    them .because they might have been ordered.(History order)so the user can quickly see the changes that have been made and the of course to export them in the report......

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Not really understanding. Changes to what - the order? A strikethrough is not deleting so exactly what are you wanting to strikethrough?
    Last edited by June7; 04-08-2025 at 12:35 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Dimitris is offline Novice
    Windows 11 Access 2021
    Join Date
    Apr 2025
    Posts
    3
    i made a mistake before i wanted to say without deleting from the list.i have standard contitional formating when the materials were ordered or not .but i want to change the font name with the strike through when the material have been cancelled.

  6. #6
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    433
    you can download a free strikethrough font.
    change your text field to Long text (Rich text format) so you can apply Any font to it.

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,930
    use something other than strikethrough - for example, set the forecolor to a lighter shade, use italics (or both), use a different back colour. Set normal text to be bold, cancelled to be normal. Have a separate control to indicate 'cancelled'. Plenty of options.

    The only way to use strikethrough would be to use richtext and set the font - but choose a font that support strikethrough - see this example https://www.access-programmers.co.uk...ortcut.320457/

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Never downloaded a font so decided to see what I could do. Found https://www.1001fonts.com/bptypewrite-font.html
    Downloaded file then right click > Install for All
    The font shows up in FontName property list.
    Every computer using DB would need to have font installed.
    Can dynamically format text in UNBOUND textbox set as RichText by calling a custom function. I set textbox FontName property with Courier New. In ControlSource call function:
    =FormatText([TextToFormatField],[CriteriaField])

    Custom function like:

    Code:
    Function FormatText(t, a)
    If a = "this value" Then
        FormatText = "<font face=BPtypewriteStrikethrough>" & t & "</font>"
    Else
        FormatText = t
    End If
    End Function
    Or instead of VBA, this expression in textbox:
    =IIf([CriteriaField]="this value","<font face=BPtypewriteStrikethrough>" & [TextToFormatField] & "</font>",[TextToFormatField])

    Is it really worth all this bother? Why not just set color with Conditional Formatting? A 'greyed out' effect would likely be just as good or better than strikethrough.
    Last edited by June7; 04-08-2025 at 10:02 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    As others have indicated, strikethrough isn't available in Access.
    If you want that effect, the only solution is to download a strikethrough font such as BTTypewrite. See my article: Strikethrough Font in Access

    Otherwise use conditional formatting as already suggested.
    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!

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

Similar Threads

  1. How to link two continuous forms with VBA?
    By steve7800 in forum Forms
    Replies: 6
    Last Post: 09-06-2020, 08:10 PM
  2. Replies: 2
    Last Post: 01-01-2014, 02:10 PM
  3. division on vba with formating
    By joshynaresh in forum Forms
    Replies: 5
    Last Post: 10-23-2013, 06:04 AM
  4. Formating a control in MS Access Reports
    By Alex Motilal in forum Access
    Replies: 3
    Last Post: 11-15-2008, 09:09 PM
  5. Querry formating
    By Zoroxeus in forum Queries
    Replies: 0
    Last Post: 03-07-2006, 11:00 PM

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