In our Microsoft Access, VBA, and VB6 programs, we often need to pauseprocessing for a certain period of time, or until a specific time, and thencontinue processing. One common way to do this is to use the DoEvents function in a loop whilewaiting, however, this method consumes the CPU time and slows down the PCconsiderably. This is a significant problem when pausing for more than a coupleof seconds, when users will notice the slowdown. Use the Sleep command instead.
Learn more about our royalty-free MicrosoftAccess/VBA/VB6 module code.
Microsoft Access, VBA, and VB6 include a wide range of built-in Date functions, including DateAdd, which calculates the difference between two dates. A common need, however, is to add a number of weekdays to a date, without counting weekend dates.
Learn about this and all our royalty-free module code in Total Visual SourceBook where you can also perform business day math with a list of holidays to avoid.
In Microsoft Access tables, the AutoNumber field type allows you to automatically assign a unique sequential number to each row in a table. AutoNumber fields are often used as the Primary Key, since they are unique and permanent.
By default, AutoNumber begins with 1. However, you may want to start with another number. Here's an easy way to set the AutoNumber at a number higher than 1.
(NOTE: This tip was revised on March 26, 2010 to fix a typo in the SQL syntax.)
The release candidate of Office 2010 is now available, and Office 2010 is expected to be shipping by mid-year. Hopefully you take the chance to download it, or at least review some of the many videos and articles about the new features.
For Access enthusiasts, the new version makes Access even more accessible to non-developers by exposing more functionality without requiring code or queries. For example, Reports are much richer, with added calculation tools and the ability to combine data from multiple sources. Microsoft has also created a whole new set of Templates to get users started more quickly, and what can be characterized as data triggers for Jet databases.
Most interesting is the ability to create solutions that can be exposed to the web. There are lots of restrictions and it’s not the same as putting an existing Access application on the web, but by leveraging SharePoint and cloud computing, it’s a whole new option for Access users and developers.
Part of Office 2010 is the Office Web Applications (OWA), a web version of Excel, PowerPoint, Word programs that allows you to create, edit and host Office files on the web without having Office installed locally. Microsoft is actually providing 25GB of space for you for free on their new SkyDrive site (with you Microsoft Live account).
Note: After losing a court case in the UK, Microsoft has renamed SkyDrive to OneDrive.
In our continuing coverage of query tips and techniques, we've create a paper focused on the DELETE query in Microsoft Access. It covers the basics of DELETE query SQL Syntax. It's a very powerful feature and a fundamental part of relational databases since you can remove multiple records at one time, and can specify which records to delete by linking to data in another table.
The paper also covers these more advanced topics:
- Query fails: "Could not delete from the specified tables"
- Use DISTINCTROW with Delete Queries for Non-Key Field Joins
Understanding and using Delete Queries improves the performance of your applications and makes them easier to maintain versus doing the same changes manually or in code.