Access 2007 - Event help

Soldato
Joined
29 Jan 2004
Posts
3,473
Location
Earth
I've added an OnClick event that adds the current date and time to a textbox, but, when the time gets added, it deletes everything that is already in the textbox. Is there a way to stop this, so that it just adds on to what is already in the textbox? i.e.

"hello there whats up
date/time
more stuff
date time
"

Here's the code:
Code:
Private Sub Notes_Click()
    Me.Notes = Now()
End Sub

Thanks!
 
66666666666666666666qi8.jpg


In the above text box, I entered "hello", followed by the date/time event. However, "hello" text got replaced by the date/time. I deleted everything and tried again a few times, but now it gives me the above whenever I use the event.

So basically, it doesn't like sharing the date/time with normal text together.

Thanks

Edit:

I deleted the data from the 'notes' field in the table instead and then tried again:

8777777777777777777xm4.jpg


That looks ok. But If I enter some text after the above time, followed by the time again, the newer text gets replaced. When I delete everything from the textbox, I get the same thing happening as the 1st pic again but with "test time time time time time time time" instead. Hope you understand, its kind of hard to explain!
 
Last edited:
Yeah can see what you're saying.

Simple way I'd have thought is to have the textbox for the collection of "notes" as a seperate entity and the user enters the new note in another textbox.

That way any new note is merely appended to the existing notes using the method I've mentioned.
 
To me it would be better to have a date field associated with the notes and store it that way from either a hidden text box or a simple variable in the code.

It depends on how you've laid your data out whether this is a good idea or not though.
 
Back
Top Bottom