Hello everyone. First off, i'm new to access, i've never used it before, but i'm helping a friend at the office.
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:
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...
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
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.



Back to top









