using access for email campaigns - automatic date sent insertion?

G

Guest

I don't know if this is possible. I send out emails to targeted people who
have registered with my site via mail merge. Is it possible for Access to
insert a date in the database every time I select a record and merge it?
Currently, I have to manually insert the dates and it's extremely
time-consuming.
 
A

Arvin Meyer [MVP]

Lroberts said:
I don't know if this is possible. I send out emails to targeted people who
have registered with my site via mail merge. Is it possible for Access
to
insert a date in the database every time I select a record and merge it?
Currently, I have to manually insert the dates and it's extremely
time-consuming.

In your code, add a recordset update (air code):

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String

Set db = CurrentDb

strSQL= "Select DateField From YourTable Where ID = & Me.txtID" ' The ID
From your Email Form

Set rst = db.OpenRecordset(strSQL, dbOpenDynaset)

With rst
.Edit
!!DateField = Date ' Current Date
.Update
End With

Then clean up and close. If there are multiple records, use the Form's
RecordsetClone or the same query that returned your dataset as your strSQL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top