Results 1 to 5 of 5
  1. #1
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296

    Different Forecolors per continuous form row?

    I have a continuous form where I am trying to have ghost text (in the textbox format I have '@;"text"') and I am using the on enter and on exit events to change the text to black when something has been typed.
    By default I want the text to be a light gray indicating that there is no text but also telling the user what goes in each field.
    It works pretty good except for after I start entering text it changes the forecolor to black which also changes the forecolor on the next row.
    I want the forecolor on the next row to stay gray until something is entered but have the text on the previous row be black since it has data in it.



    Is this possible? If the form had an On change event I could write an if statement to check for null and set it to gray but that would run so much and it doesn't exist.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    You cannot alter such properties in instances of a control like a textbox in a continuous form since in reality there is actually only one control. Conditional Formatting can do it though. IIRC, something has to identify the record(s) using an expression. I suppose that could be to test if the control value is not "text" then make the font black.
    Last edited by Micron; 03-06-2023 at 01:15 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Programmatically setting control properties will show same for every record because there is only one control.

    Use Conditional Formatting.

    Or does the solution in your other thread https://www.accessforums.net/showthread.php?t=87702 apply?
    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.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Accidental duplicate.
    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
    Vita's Avatar
    Vita is offline Competent Performer
    Windows 10 Access 2002
    Join Date
    May 2022
    Location
    Massachusetts, USA
    Posts
    296
    Quote Originally Posted by June7 View Post
    Programmatically setting control properties will show same for every record because there is only one control.

    Use Conditional Formatting.

    Or does the solution in your other thread https://www.accessforums.net/showthread.php?t=87702 apply?
    This worked perfect thanks!

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

Similar Threads

  1. Replies: 2
    Last Post: 02-22-2017, 05:45 AM
  2. Replies: 2
    Last Post: 11-09-2016, 05:54 PM
  3. Replies: 4
    Last Post: 06-02-2016, 09:03 AM
  4. Continuous search form won't open selected record in view form.
    By IncidentalProgrammer in forum Programming
    Replies: 20
    Last Post: 03-24-2015, 02:53 PM
  5. Replies: 2
    Last Post: 01-01-2014, 02:10 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