Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2003, 05:30 PM
Authorized User
 
Join Date: Nov 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding a date to a memo field

I would like to create a control that would put the current date at the top of a memo field each time a user clicks on the control.

Any information would be greatly appreciated

 
Old November 25th, 2003, 09:49 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why would you want to put a date in a memo field? just put a date in a date field and if you need to append the date to the memo field at run time, do that instead.

dates go in date fields.



Sal
 
Old November 25th, 2003, 10:35 PM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

An usual request but ....

Option Compare Database
Option Explicit

Sub AddDateToMemo()
Dim TheMemo As String
Dim Db As DAO.Database
Dim Rs As DAO.Recordset
Set Db = CurrentDb
Set Rs = Db.OpenRecordset("memos")

Do
TheMemo = Rs!memofld1 ' get the current memo
With Rs
  .Edit
  !memofld1 = CStr(Now()) & "__" & TheMemo ' update the memo
  .Update
  .MoveNext
End With

If Rs.EOF Then
   Exit Do
End If
Loop

End Sub


Dave






Similar Threads
Thread Thread Starter Forum Replies Last Post
Memo Field Brendan Bartley Access 11 December 13th, 2007 04:28 PM
Adding a blank line to a memo field Scootterp Access VBA 3 October 31st, 2006 01:15 PM
Memo field not displaying meichmann SQL Server ASP 3 August 31st, 2006 11:36 AM
MEMO FIELD! With VB6 rolandatem Pro VB Databases 2 January 28th, 2005 10:49 PM
Pagefault from memo field dave_pollak Access VBA 0 November 24th, 2004 10:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.