Need help moving text around using VBA!

Bachfile

Registered User.
Local time
Today, 12:57
Joined
Jul 4, 2002
Messages
41
Hello again!

I am doing an "Updates" form which has name, time, date and updates done fields so that updates/changes to the database are recorded on a regular basis.

I have removed the navigation bar and instead of having a separate record for each update, I wanted to append or add to a locked memo box that would show the combined information of each update (which includes name, date, time etc.)

Here is the code for the button which moves the text into the locked memo box:

Private Sub Command10_Click()

Dim rs As String
rs = Me.Person & Me.Date & Me.Time & Me.UpdateEntry
Me.PermanentIndex = Me.PermanentIndex & rs

Me.Person.Value = Null
Me.Date.Value = Null
Me.Time.Value = Null
Me.UpdateEntry.Value = Null
Me.Form.Refresh
Me.Time.Requery
Me.Date.Requery

End Sub

This works - it does move the text BUT I was wondering how I could get the output from looking like:

John Smith12:3509/09/2002Added a new text box etc.

to
Modified by:John Smith
At: 12:35 PM
on: 09/09/2002
Updates added: Added a new text box

I'm not sure how I would do that as I am not fully sure of the syntax for these commands. (I'm not extremely fluent with VBA)

Also, do you guys know what exact command I would use in the Default Value field for the date and time so that I could have that entered automatically every time I make a new update?

Thanks a lot in advance guys!

Bachfile
 
Use vbCrLf.

...
Dim rs As String
rs = Me.Person & Me.Date & Me.Time & Me.UpdateEntry
rs ="Modified by:" & Me.Person & vbCrLf
rs = rs & "At:" & Me.Date & vbCrLf
rs = rs & "on:" & Me.Time & vbCrLf
rs = rs & "Updates added:" & Me.UpdateEntry
Me.PermanentIndex = Me.PermanentIndex & rs
...
 
Thanks a lot Tim! That works perfectly now!


Just one more thing. I wouldn't mind having the date and time entered automatically every time someone wants to enter an update. I've tried making a new command button with code to requery the time and date fields, but this doesn't work. The time and date don't show up. The only time they DO show up is when I create a new record. I don't want to do that though.

Is there some way to allow me to update the date and time via the system clock as many times per record as I want without creating a new record for each entry?

Thanks for all the help!

Bachfile
 

Users who are viewing this thread

Back
Top Bottom