Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Kirana123 is offline Novice
    Windows 10 Access 2021
    Join Date
    Oct 2023
    Posts
    8

    How to Highlight an entire row in a sub form in ms access

    Hello,



    Could you please help how to Highlight an entire row in a sub form in ms access

    see printschreen and attachement.

    Attached Thumbnails Attached Thumbnails Photo1.jpg   Photo2.jpg  

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Something like this?
    Click image for larger version. 

Name:	Capture.PNG 
Views:	65 
Size:	46.2 KB 
ID:	50992

    Screenshot from my article https://www.isladogs.co.uk/emulated-...orm/index.html

    A quick Google search will give lots of articles explaining how this is done. For example: How To Highlight The Current Row In A Continuous Form In 3 Steps (vbahowto.com)
    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!

  3. #3
    Kirana123 is offline Novice
    Windows 10 Access 2021
    Join Date
    Oct 2023
    Posts
    8
    Yes, how to make it

  4. #4
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    I've given you two links - one to a working example and the other to detailed instructions. Now its up to you to implement this for yourself.
    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!

  5. #5
    Kirana123 is offline Novice
    Windows 10 Access 2021
    Join Date
    Oct 2023
    Posts
    8
    Quote Originally Posted by isladogs View Post
    I've given you two links - one to a working example and the other to detailed instructions. Now its up to you to implement this for yourself.

    I tried to make it like the one in the link but the results are not the same as the one in the link I attach photos and databse
    Attached Thumbnails Attached Thumbnails Photo3.jpg  

  6. #6
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Here's another example with a continuous form, an emulated split form & a datasheet (where the effect is built in)
    Study the continuous form example which is slightly different from that on the vbahowto.com link
    Attached Files Attached Files
    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!

  7. #7
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,566
    Firstly, that dummy field has to be on the detail line. Then you need to apply conditional formatiing to every control on that record?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  8. #8
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    My approach is slightly simpler. Only one control needs to have conditional formatting applied

    I've just written detailed instructions in a new web page: Highlight Current Record in Continuous Form (isladogs.co.uk)
    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!

  9. #9
    Kirana123 is offline Novice
    Windows 10 Access 2021
    Join Date
    Oct 2023
    Posts
    8
    I tried to make it like in the example but it didn't work, please see in my databse, what I did wrong. I'm a little crazy about this matter

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,566
    Quote Originally Posted by Kirana123 View Post
    I tried to make it like in the example but it didn't work, please see in my databse, what I did wrong. I'm a little crazy about this matter
    Attach your DB again, do NOT make us going to look for it? :-(
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #11
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    My new web article provides detailed instructions along with an example database showing that in action.
    The last screenshot you showed preceded me doing that.

    I spent almost 2 hours creating that article. Study it carefully & apply it to your own database.

    I'm not going to do the rest of this for you or you will learn nothing.
    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!

  12. #12
    Join Date
    Apr 2017
    Posts
    1,792
    In your post #1, I see a continuous form, but on your picture it is somehow weird - the are no record selectors at left of every row (look at Isadog's post #2 - in 11th row which is selected one, it is black, with tiny arrow in it)

    In your later postings, all those pictures are displaying various single forms. In single form, the displayed row is always the selected one.

    So I'm somewhat confused - what are you meaning with "highlight", and for what you need this. I'm suspecting you want to copy the entire row from form, and paste it somewhere!

  13. #13
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    @Arvil
    It is a continuous form but the OP didn't correctly follow the method described in my link in post #2.
    The yellow box on the top right is a 'marker' used to indicate the current record ID. Its normally hidden

    I've since provided a working example and detailed instructions for a simpler method but he(?) hasn't shown any indication of having tried it

    BTW Record selectors aren't required in a continuous form nor are they needed to highlight the current record (though it may make it easier to do so)
    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!

  14. #14
    dodo is offline Novice
    Windows 10 Access 2019
    Join Date
    Jan 2025
    Location
    BE
    Posts
    5
    Dear Isladogs,

    thank you a lot for your example on your website, which i have found through the big search engine.
    In my case, I am trying to replace a listbox, with let's say tasks, with a continous form so i can use conditional formatting if a task is beyond its deadline.
    In a later phase in my form Orders, I want to also add images, as a visual reference for the user, in my listbox for Orders so I think I'll need to replace it with a continous form too.

    But in both cases i would like to remove the feeling you are in a continous form, they are looking very archaic imo.
    For this I would like to: -hide the grey column with row indicators, and replace it with highlighting.
    Hiding the grey column I found is possible through setting the record selector and navigation buttons property to no, on the form control itself.

    I found your method is working if the records are enabled. But in my case the records arent editable, I really want it to work as a common listbox. I adapt and create rows in subforms through cmdbuttons.

    In case anyone would know how to have a workaround for this, because I cannot think of one.

    Thank you for posting the solution, it is very nifty.
    Kind Regards
    d

  15. #15
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Limited formatting is possible with listboxes. See Add colour to queries, listboxes & combo boxes. However, though I doubt it will be sufficient for your needs
    However in general using forms or subforms gives much greater flexibility

    I'm not sure I understand your issue
    Unlike datasheets, the appearance of continuous forms can be modified significantly to suit your preferred style.

    The approach I demonstrated works perfectly with both record selectors and navigation buttons hidden.
    In fact that is my normal mode of working

    I've just checked and it also works if AllowEdits is set to No so the form is locked
    It also still works if each control is disabled and/or locked as in this screenshot:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	33 
Size:	28.1 KB 
ID:	52577

    If you still don't like the appearance of continuous forms you could try using a split form with the splitter bar moved to the top disabled so the single form section is hidden
    That will leave you with a datasheet form with any controls from your split form

    Or you can use an emulated split form but with a continuous form in the lower half.
    See these various articles:
    Simulated Split form ; Split Form Issues ; Emulated Split Form

    I also have a lot of other articles on ways of enhancing continuous forms which I've collated at: You Can REALLY Do All That With Forms?

    I'm sure you can find something that does what you want & looks OK to you
    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!

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 10-16-2018, 05:19 AM
  2. VBA to highlight missing fields in a form
    By nick404 in forum Programming
    Replies: 13
    Last Post: 07-30-2015, 08:33 AM
  3. how can i highlight a selected row in form?
    By joe55555 in forum Access
    Replies: 4
    Last Post: 08-29-2013, 01:19 PM
  4. Replies: 5
    Last Post: 07-09-2013, 11:16 AM
  5. Replies: 9
    Last Post: 12-28-2009, 04:01 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