473,670 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

AutoExec Macro Help

27 New Member
I have 2 AutoExec macro's that run at a specified time every morning (1am) but 1 of those macros can't be run more then 1 time a day. I found a set up on a previous post that almost solves my problem, but the StopMacro condition gives me a syntax error.
Here's what i have so far...
A table named "tblLastUpd ate" with a field "DateUpdate d"
A query in the macro which will append that table with the date it runs on. (should this be an append or an update query?)

The Macro condition i found is
DCount("*",tblL astUpdate","[DateUpdated]#="&Date()&"#") =0

but it gives me a missing operator syntax error any help would be wonderful
Jan 13 '11 #1
4 2062
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
Try
DCount("*",tblL astUpdate","[DateUpdated]=#"&Date()&"#") =0

I think you should be able to do simply:
DCount("*",tblL astUpdate","[DateUpdated]=Date()")=0
The last solution is neater and faster, and should work, though I havent done much work in macros.
Jan 14 '11 #2
kini113
27 New Member
I don't get an error message with those condition syntax but it doesn't stop the macro from running even when the condition is met. Baffled....
Jan 14 '11 #3
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
And you have tested that the expression
DCount("*",tblL astUpdate","[DateUpdated]=Date()")=0
evaluates as you expect it to?

Ie. that it is false when you have data for that date in the table.
Jan 14 '11 #4
kini113
27 New Member
Changed it to make it a true statement and it works :) Thanks so much for your help
Jan 14 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
4013
by: MLH | last post by:
My autoexec macro in an Access 2.0 database has 2 lines. The first runs DoMenuItem - Database - Window - Hide. The second lines is Runcode - Initialize(). Initialize is a procedure in a global module that opens a form. When the form opens, the database window is still present and visible. I thought the first line of the macro would run to completion before the second line started and certainly before any lines in Initialize() were...
4
6157
by: mvivar | last post by:
Hi everybody: This will be not easy to explain as my mother language is not english, so my apologies in advance if it sounds confusing. We have a database access 97 wich controls time of people in their job in order to finally know how many money costs us to run some projects. People always estimates the time when reporting and we do have the impression they really underestimate the time.
5
1877
by: MLH | last post by:
I have problems getting the CTRL-d, CTRL-w and other 'hotkey combo' assignments to work in Access 97. I just imported the autoexec macro directly from Access 2.0, so its no surprise. Some are really simple, though... For instance, CTRL-w should just launch ScreenDump(). I can run the FN by calling it this way... dim y as variant y = screendump() But I cannot get the CTRL-w to launch it the way it did in Access 2.0.
6
3641
by: MLH | last post by:
Did A97, perchance, do away with the need for an AutoExec macro to initiate an autoexec sequence for databases? Or, must we still suffer with that hideous macro?
6
6431
by: Takeadoe | last post by:
Dear NG, Can someone assist me with writing the little code that is needed to run an update table query each time the database is opened? From what I've been able to glean from this group, the Autoexec Macro looks like the way to go. Could someone please assist? Thank you very much! Mike
2
1584
by: dstorms | last post by:
Something very strange going on here! Don't know where dstorms original post went! The post, in essence, stated that his form, containing a checkbox and a textbox, opened fine if opened independently, but opened without any controls showing if opened thru the Autoexec macro. The form was set up to open only Where ...checkbox = 1, but would open as stated above, with no controls showing, whether the box was checked or unchecked. ************** ...
1
2103
by: Pittsford | last post by:
I used Sendkeys extensively in Access 97 to enter repetitive text into fields directly in a table. I am now using Access 2000 and none of the SendKeys macros work. I allowed Access to "convert" the mdb file and I tried re-creating the AutoExec macro from scratch. No luck. I emailed the Access 97 mdb file to a friend who has Access 2003. He allowed Access 2003 to convert the file and the SendKeys macros work perfectly. Does anyone know why...
8
18776
by: kini113 | last post by:
I want to update my database every night at 10pm. I have a Macro that runs all of the queries needed to update the database (which is also saved as a VBA module) and an AutoExec Macro to runs the "Update Inventory" macro. I also scheduled the task to run every night a 10pm. The problem i have is that in order to run the "Update Inventory" macro I have to enter my ODBC password and there is no way to save the password. This there a Macro...
4
4554
by: kini113 | last post by:
I want to update my MS Access database every night at 10pm. I have a Macro that runs all of the queries needed to update the database (which is also saved as a VBA module) and an AutoExec Macro to runs the "Update Inventory" macro. I also scheduled the task to run every night a 10pm. The problem i have is that in order to run the "Update Inventory" macro I have to enter my ODBC password and there is no way to save the password. This there a...
0
8388
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8907
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8817
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8593
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8663
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7423
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5687
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2804
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.