Results 1 to 12 of 12
  1. #1
    TenOc is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2015
    Posts
    94

    Is there a way highlight the first field in the last record In a continuous form?


    I have a form which is a continuous view form. Is there a way highlight the first field in the last record which is for new data? I want to draw the user’s attention to the bottom of the form so they can add new records as necessary.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Quote Originally Posted by TenOc View Post
    I have a form which is a continuous view form. Is there a way highlight the first field in the last record which is for new data? I want to draw the user’s attention to the bottom of the form so they can add new records as necessary.
    What is the data type of the field that you want to highlight and is it ever a null once the record is entered.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    TenOc is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2015
    Posts
    94
    Quote Originally Posted by Bob Fitz View Post
    What is the data type of the field that you want to highlight and is it ever a null once the record is entered.
    It is a short text once I enter the new record. Before I enter the new information I assume it is null, but NEVER null after the record is entered since it is a required field.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Take a look at the attached db.
    Attached Files Attached Files
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    This requires adding a field in table.

    I am curious about displaying the default value of NonData textbox on new record line. I changed ForeColor to black and the value still does not show. Why?

    I changed rule to: Expression is: [txt] Is Null

    And now the default value of NonData shows. So I made this an UNBOUND textbox without a default value and deleted NonData field.
    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.

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    I am curious about displaying the default value of NonData textbox on new record line. I changed ForeColor to black and the value still does not show. Why?
    Might that be because both the background colour and the text colour are controlled by the conditional formatting rule.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    Okay, I see now that the CF selection controls don't actually display what is selected when rule is opened for edit, they show defaults which is most likely not what was set up and showing in the preview box. Just me crossing wires.

    Could set each textbox and combobox with transparent background to get more solid color block. And control that has focus will show white.

    Set focust to [txt] instead of ID. ID doesn't even need to show.
    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.

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,798
    I'm confused by some of the responses - probably am not interpreting them correctly. First, the name of the selected control for the rule to be edited does show beside the Show formatting rules for: combo. If it's not the one you want you can select the right one.
    There is a 'control has focus' option so set the formatting for the desired control and then use something like

    DoCmd.GoToRecord acActiveDataObject, , acNewRec
    Me.NameOfYourControl.SetFocus

    or no? I have no idea what OP wants to use as the trigger though.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    TenOc is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Feb 2015
    Posts
    94
    Bob, Thanks for the suggestion. It works, but is too complicated. I have found a solution.

    1. I set the conditional format of the background color first field to green when it has focus.
    2 When the event form current I go to record new.

    Thus I draws the users attention to add a new record. It is not perfect because anytime the user moves to any of the record's first fields it is highlighted.

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,798
    Then I suppose you could delete/add format conditions based on whether or not you're on a new record when the GotFocus event fires. If not, turn it off (or delete). If yes, leave it (or create it). I have very little vba experience with CF and have been trying to figure out the Modify method but it's mostly Greek to me.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,798
    This seems to work
    Code:
    Private Sub Last_Name_GotFocus()
    Dim fc As FormatCondition
    
    If Not Me.NewRecord Then
       Me.Last_Name.FormatConditions.Delete
    Else
       Set fc = Me.Last_Name.FormatConditions.Add(acFieldHasFocus)
       fc.BackColor = vbGreen
    End If
    Set fc = Nothing
    
    End Sub
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,543
    Bob, Thanks for the suggestion. It works, but is too complicated. I have found a solution.
    Why is it too complicated?
    I'm happy to try to help further if I can.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 1
    Last Post: 01-21-2021, 05:12 PM
  2. Replies: 4
    Last Post: 10-30-2020, 05:14 PM
  3. Replies: 2
    Last Post: 03-06-2015, 07:07 PM
  4. Replies: 5
    Last Post: 07-09-2013, 11:16 AM
  5. Replies: 0
    Last Post: 10-16-2008, 02:39 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