Go to last record in continuous form and highlight it

spudracer

Here and there
Local time
Today, 17:23
Joined
Jul 1, 2008
Messages
199
I have a log of items I currently inventory. When you click on an item, it opens another form with a sub-form that lists the history of changes for said item in a continuous form display.

What I want to be able to do is when that form is opened, the sub-form will highlight the last entry (either bold it, or change the background).

I'm having a little trouble actually getting this to happen though, any thoughts?

Confusing, I know.
 
If the subform is a continuous form, then you need to use the "Conditional formatting" in a way, because without "Conditional formatting" you can't change the background or something else for a single row/record.
 
If the subform is a continuous form, then you need to use the "Conditional formatting" in a way, because without "Conditional formatting" you can't change the background or something else for a single row/record.

After doing a bit of searching, I found that Conditional Formatting was probably the way to go, but can't seem to put my finger on the correct expression to use. Would I use DLast, or something else entirely?
 
Here are some steps:
1. Place a textbox in the Header section of the form, and bind it to the ID field, where ID is the unique identifier field. Call it txtCurrentID.
2. Place a textbox in the Detail section and spread it as wide and as high as the Detail section, then Send it to the back. Call it txtBack.
3. Set the Locked property of txtBack to Yes and the Enabled property to No.
4. Set the Control Source to ID, again.
5. Set the Conditional Formatting expression for txtBack to:
Code:
[I][COLOR="Blue"]Field Value Is[/COLOR][/I]
[txtCurrentID]
6. Set the Conditional Formatting back colour to whatever colour you choose and ensure that the fore colour is the same as the back colour.

Get this working and we can work on moving it to the last record.
 
Would it be easier to say that I have a Date/Time field, that I would only need the most recent row highlighted?
 
Whichever field you choose, it's up to you. As long as that field is unique.

Actually, I'm going to revise step 1 and add an extra step:
1. Place a textbox in the Header section of the form and call it txtCurrentID.
.
.
.
7. In the Current event of the form add the following code:
Code:
Me.txtCurrentID = Me.ID
 
I opted to just leave it out. It wouldn't be very helpful, other than highlighting the last entry.

Thanks for all of your assistance, though!
 
Oki doki! And you've managed to move it to the last record?
 
rather than moving to the last record, why not display the records in reverse order, then the automatic selected record will be the first record, which is the one you want
 

Users who are viewing this thread

Back
Top Bottom