We are using access 2007 on a pc running vista.
I've surfed the internet for a while trying to understand how to run a macro with a SQL query in it, but i just can't seem able to make it work. It keeps saying that i'm trying to use a function that office can't recognize.
The macro is a button that, when clicked, runs a certain code I made as a tester (which is probably the problem). The function code is:
Function Revisar_Calendario()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim qdef As DAO.QueryDef
Dim consulta As String
Set db = CurrentDb
consulta = "SELECT Plazo FROM Actividades WHERE Plazo - Date < 7 Days"
Set rst = db.OpenRecordset("consulta plazos")
End Function
The idea is to go through a table and gather the items which are coming to a certain date (and, if possible, send an email alerting the participants, which shouldn't prove very hard once i get the hand of the syntax)
Please, if someone could guide me a bit, it would be wonderful. I've searched for tutorials, but haven't had any luck with the ones i've found, so if anyone has a tip there, that's also greatly appreciated
~Pedro
---------------------
I guess that instead of "7 days" i should use "Date - 7" or something of the sort? I never understood very well the dating systems...
This post has been edited by petocities: 15 January 2009 - 11:11 AM

Help



Back to top









