Date stamp inside a Text Box

anishkgt

Registered User.
Local time
Today, 06:31
Joined
Nov 4, 2013
Messages
384
Hi All,

Need a little help with adding a date stamp on each line inside a text box when the form is opened. i've managed to add this expression to the text on got focus

=Date() & "/" & [IncidentDetail]

This every time adds the date stamp to the first line of the text box and not below the sentence or next line.
 
Is this the control source of the text box? Look into Form Current VBA.
 
Yes it is. Did not get you "Look into Form Current VBA. " The expression in the previous post shows [06-Aug-14 at 12:25:45 PM]. which is exactly what i want but need make it appear in the next line above previous entries.
 
What I meant was,
Code:
Private Sub From_Current()
    Me.IncidentDetail = Me.IncidentDetail & vbCrLf & Date()
End Sub
 
Not much of vba knowledge. Where do i add this in macro ?
 
picture.php


Instead of Click look for Current property !
 
Ok managed to get that done. But i need to execute it if a condition is met with if else.

I've got it all done with macro except for the add date in the next line
 
Give the If condition, I will code it for you in VBA.
 
Thanks and is it possible to put the date above all, like when a new comment is added it should appear at the first rather than at the bottom. The if condition is in the attachment.
 

Attachments

  • IfClause.jpg
    IfClause.jpg
    22.4 KB · Views: 139
Okay this is simple to code, but here is the alternative (or as my dad used to say here is how you should do it). Create a new log table. Insert Notes based on Date and Client. Then you link them up together. So each client will have one or many notes, you can either use a ListBox or a SubForm to list the notes in the desired Format.

With the current structure you are editing/adding more data to the same column, if this is set to Text, you will hit a brick wall soon. If it is set as Memo then you will face some problems that already exists with Access & Memo fields (http://allenbrowne.com/ser-63.html). Also searching for a particular notes is not possible, efficiency is reduced.
 
Aite ! Reuben Let me check on that, i did think of it but did not worry much about it. You being a pro, will take the advice and do it.:)
 
Ruban.:) it is Sorry got the spelling wrong though pronounced correctly.

So your suggestion is to create another table which contains the followups for an incident and link those followups to the incident table, rite !
 
Ruban.:) it is Sorry got the spelling wrong though pronounced correctly.
I am not worried about the spelling, where did you get my real name from? I only use Paul or Eugin, very rarely Francis. Never Ruban. So am a bit shocked/confused.
So your suggestion is to create another table which contains the followups for an incident and link those followups to the incident table, rite !
Yup something along those lines. When you are done creating tables, post an update we will see if it will be the apt one for your need and get it fixed if not ;)
 
Hi Paul,

Just completed the table. Since i could add the date field in the table, i won't be needing the script anymore but thanks for the effort and advise :) and regards to Ruben.
 
anishkgt

Paul just demonstrated one of the fundamentals of learning... What you are trying to learn is not necessarily what you think you are trying to learn.


I am not worried about the spelling, where did you get my real name from?.....So am a bit shocked/confused.


Paul or Eugin or Francis or Ruban, have you heard of the internet?:banghead: You'd be amazed what you can find out on there.
Likes of pr2-eugin
  • Singing and Laughing Out Loud (singing??? ;))
  • One Direction (embarrassing :eek:)
  • Isskint (you got class :o :rolleyes:)

Perhaps anishkgt works for a national security agency, press or a higher power (Google?), I think its touching anishkgt went to that effort :D (Paul you know i luv ya really :p)
 
Paul or Eugin or Francis or Ruban, have you heard of the internet?:banghead: You'd be amazed what you can find out on there.
Ha Ha my real name is quiet long winded. So I prefer to be called Paul Eugin Or simply Paul Francis.
  • One Direction (embarrassing :eek:)
Embarrassing indeed ! Ha Ha !

I think its touching anishkgt went to that effort :D
Not as far as I hoped he'd go. Lol. :p
(Paul you know i luv ya really :p)
Oh yea ! Then why have you not responded to the AWF Meeting?
 
Gon further on what ? Pulling pauls leg ? Well, thats not me, at least not when in a forum. :)
 

Users who are viewing this thread

Back
Top Bottom