Instead of assuming the previous record is only 1 value before the current one, you could search for the highest autonumber value that is less than the current one.
Glad to hear you got it working, but using -1 in your expression may not be reliable. Potentially, you could end up having gaps in your Autonumber fields and -1 will end up failing. Just a thought…
Can you show us your CF expression? Are you using an Autonumber field as the primary key? Or, so you have a date field to help determine which record is the “previous” record?
Still only using my phone, so can’t see what Arnel provided, but I have a feeling it would include a similar function if it was needed. If you’re still curious to see what my function looks like, you can go to this link.
SimpleCSV()
Are you looking for more than one set of brackets? Have you tried?
Like “*(*)*”
PS. Typing from phone, not sure why it created a smart quote. Make sure to type the above code into your project manually, don’t copy and paste.
My guess is that when you assign a fore color using CF, you basically are also assigning a back color as well. I guess the default color is white. If you select a different back color, you'll see the same effect as you're getting now with white.
So, I continued with my experiment to verify this statement. I can confirm that the subform is getting dirtied when using the With and .Recordset.Addnew. However, the original text control seems to retain the focus - meaning, the subform does not become active by using this code.
There is one...
So, while waiting for a demo, I finally had a chance to fire up the laptop and do some tests.
It seems to me that in the AfterUpdate event of a control, that control still has the focus. So, sending or setting the focus to that same control is unnoticeable, because it already has the focus and...
Perhaps you are right, but I am not sure that it also means the subform was dirtied, since the code directly modified its recordset. If that is the case, then you would be correct to use the subform’s AfterUpdate event.
Actually, I just re-read your post, so I may have misunderstood your...
Don’t think I can answer that question without being able to step through the OP’s code, so a demo file would probably help us figure out the actual cause of the problem.