You don't need to extra query, in the control source for the reversed text textbox just add the custom function like in the query field.
Cheers,
You don't need to extra query, in the control source for the reversed text textbox just add the custom function like in the query field.
Cheers,
I'll give you some of that for sure, but I can tell you it does work on the single form control but correct, not on the datasheet. The entry you see is the 3rd row value even though it is high enough to show multiple rows.
Not disputing anything you wrote and I agree the linked code is better for this case. Just thought you might like to know.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Gicu,
I've tried everything I can think of but I can't get it to work. I put your module into my db, built a query to match the table, added text box... everything to make it match your example, but I just keep getting the error "Subscript out of Range" on this line:
ReDim vTmp(a1 To a2) As Variant
I've been working this the entire day so far and my brain is fried, so I think I might take a break for awhile.. lol
Again thank you to all that commented!
Can you please post a sample text with multiple lines? You should step through the code and see why it is that.
Cheers,
Please try this updated version, I added another custom function to parse out just the last line in case you want to use that instead.
Cheers,
Vlad
Gicu,
The fnLastLine function works just like I want it to! I didn't make a query but put the function formula in the control source of another text box instead. There's 2 problems though. If there's no value in the Comment history (The text box the function refers to) then I get a #Type! error/result in the "Last History Entry" (the new unbound text box I added that has the control source set to "=fnLastLine([Comment History])" in the upper and lower portion of the form. The other problem is when I select any record, the new text box in the upper portion goes blank. I'd upload a sample, but for some reason when I do that and someone tried to open it it still gives the "Need newer version of Access" message.
Anyway, I like the way it works other than that. If you have any ideas and feel like working on it any more, I'll keep watching for any ideas.
Thank you very much for everything!
Please see this updated file. Basically try this updated version of the control source: "=fnLastLine(Nz([Comment History]))". That should fix the #Type error. As for the second I don't really get what is happening, can you maybe post a screen shot.
Cheers,
Gicu,
It works perfectly! The problem with the data disappearing I think it is a glitch with Access. Although your job is done and I am very happy with it, I am attaching a zip file with 3 screenshots in case you have experienced something like this before and want to see what I'm talking about. First of all I'll tell you why I think it's an Access glitch.
It only happens after I apply a filter to any field, even if I turn the filter back off, otherwise if I don't apply a filter when I first open the form, the problem does not exist.
If I don't have the "Last History Entry" text box hidden in the bottom portion (like it is in the pics), the problem does not exist even with a filter on.
The problem"Last History Entry" is the new text box with the formula in it)
Pic 1- You see I have a record selected in the upper portion. The "Last history Entry" field does not show (no matter which of the original fields I select)
Pic 2- I move over and select the "Last History Entry" field and the data pops back up and shows.
Pic 3- I move up and select the record above it (or any other record) and the data in the first record I selected still shows as does all of them except for the record I currently have selected.
So anytime I select a record, the data in the "Last History Entry" disappears. Very strange, but I'm sure that's a glitch like I said. But you did your job on this one and it turned out good! If I have to make the new text box visible in the bottom portion to fix that problem, that's what I'll do. I'll just make it inconspicuous.
It works good! Thank you very much!! I'll close this question and add to you reputation or give you credit... whatever my options are after I make this post!
Very good plan! Thanks!