Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 25th, 2003, 05:30 PM
Authorized User
 
Join Date: Nov 2003
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old November 25th, 2003, 09:49 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
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
Reply With Quote
  #3 (permalink)  
Old November 25th, 2003, 10:35 PM
Authorized User
 
Join Date: Oct 2003
Location: roanoke, va, USA.
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:46 AM.


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