Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlight select records on a sub-form.

Status
Not open for further replies.

weightinwildcat

Programmer
May 11, 2010
84
US
I am trying to highlight select records on a sub-form. I can easily create code to change a background color or make an object visible to mark a record. I am trying to figure out to trigger the code for some records but not others.
 
First question, I guess, is are you trying to do this by manually selecting the Records to hi-lite...or doing this based on some condition?

Hope this helps!

There's always more than one way to skin a cat!

All posts/responses based on Access 2003/2007
 
There are two ways to "select records". You can but a field in the table or create a separate table of selected records. In the first case you select or deselect a field. In the second case you add or remove values from a table. The first case is easier to do the second is more flexible.
 
At present I am working off of a calculated field in a query for my subform, as follows:

IsShipped: Not IsNull([DateShipped])

This can be displayed by a checkbox, which is acceptable. However, I would like to have additional highlighting. Also, the checkmark does not display until I click on the Refresh All button. So either way I do have an issue. I have tried several different ways to refresh my form and sub-form by using VBA code, but so far no luck.

I should also mention that I am presently working on a Chrome machine.
 
Depends on what you want to highlight, but if it is a continuous form you can do this through conditional formatting. You will be limited to 3 colors/formats and the default. If it is not a continuous form you can use code to do more. To refresh your form use me.recalc in the on current event and/or after update event of your dateshipped field
 
Actually I am using the Chrome Remote Desktop to access a Windows environment with Microsoft Office.

Good point about the conditional formatting. But that can only be done for individual objects rather than the detail section as a whole. So a checkbox works just fine. As long as it refreshes to show a check mark when a line item has been shipped.
 
But that can only be done for individual objects rather than the detail section as a whole.
You may be able to fake this depending on what effect you want. This is a textbox behind the textboxes.

SelectRecords_eh3xtk.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top