Home  freeaccess.cjb.net 
  Get v2.0 of the FreeAccess Access Utilities CD

FreeAccess Newsletter No 13 - October 2002

  Free Access Tools and Databases AAD CONSULTING Sydney Australia_ | _Advanced Access Development
     
What's New at FreeAccess?

New Downloads

Highlights:

  • Version 4.5 of Ezy Documenter - the easy way to document Access databases - now fully documents macros and all library references. Ezy Documenter automatically documents and prints in fully formatted Access reports all the major objects in your database: tables and fields, table relations, query definitions, forms and record sources, reports and record sources, all code modules, including those behind forms and reports, macros, data access pages, and library references.
  • Version 1.1 of the Mailing List Manager database. Manage large mailing lists, print labels, envelopes, export data to delimited files for mail merges, check data integrity, and advanced filtering. Also features a new Access navigation paradigm. Version 1.1 adds full label printing functionality.
  • The new SMS Call Logging Database - a fully integrated and comprehensive service/maintenance contract call and revenue management application.
  • The new FreeAccess Access KB Screensaver with the bouncing & zooming FreeAccess cube and scrolling text of 900+ Access KB references. Features single key access to the Microsoft KB and FreeAccess web sites.
 Tips
Handy Date and Time Functions
   

The current month

DateSerial(Year(Date()), Month(Date()), 1)

The next month

DateSerial(Year(Date()), Month(Date()) + 1, 1)

The last day of the current month

DateSerial(Year(Date()), Month(Date()) + 1, 0)

The last day of the next month

DateSerial(Year(Date()), Month(Date()) + 2, 0)

The first day of the previous month

DateSerial(Year(Date()), Month(Date())-1,1)

The last day of the previous month

DateSerial(Year(Date()), Month(Date()),0)

The first day of the current quarter

DateSerial(Year(Date()), Int((Month(Date()) -1) / 3) * 3 + 1, 1)

The last day of the current quarter

DateSerial(Year(Date()), Int((Month(Date()) -1) / 3) * 3 + 4, 0)

The first day of the current week (assuming
Sunday = day 1)

Date() - WeekDay(Date()) + 1

The last day of the current week

Date() - WeekDay(Date()) + 7

The first day of the current week (using settings in Options dialog box)

Date() - WeekDay(Date(), 0) + 1

The last day of the current week

Date() - WeekDay(Date(), 0) + 7

Check the Access Version in Code
 
SysCmd(acSysCmdAccessVer) = 8 'Access97
SysCmd(acSysCmdAccessVer) = 9 'Access2000
SysCmd(acSysCmdAccessVer) = 10 'Acess2002

Improve Subform Performance

  • Base subforms on queries rather than tables. Include only required fields from the record source.
  • Index all the fields on the subform that are linked to the main form. Indexes speed up the matching of subform records.
  • Index any fields used for criteria such as where a subform is based on a parameter query.
  • If you are linking on multiple fields, add a calculated field to the main form that concatenates the fields. Then, create a calculated column in the subform's RecordSource property query with the same expression.

    For example, to link to the subform on an Employee ID field and an Order ID field, add a text box to the main form with the following properties:

    Name: EmployeeIDOrderID
    ControlSource: =[EmployeeID] & [OrderID]

    Next, add the following field to the query that the subform is based on:

    EmployeeIDOrderID: [Employee ID] & [Order ID]

    Then, link the main form and the subform on the concatenated field rather than on the two individual fields. The subform properties might look as follows:

    LinkChildFields: EmployeeIDOrderID
    LinkMasterFields: EmployeeIDOrderID

    Because Access only has to compare one criteria to return the subform's recordset, the subform's performance should improve.
  • Set the subform's DefaultEditing property to Read-Only if the records in the subform are not going to be edited.
  • If your subform is a continuous form and contains combo boxes, explicitly justify the combo box in the subform's form Design view. This prevents Access from determining the proper justification of the combo box values for each record and thus speeds the display of subform records which have combo boxes.
 Downloads

HAL is a free scheduling tool which lets you schedule database compacts, repairs, and macro runs, and, unlike the Windows Task Scheduler, lets you do this on secured databases without compromising account security. Supports Access2 and later.

ssw.com.au features a number of high-end Access and SQL Server Tools for free downland.

Handy Access Code Samples

UnTools Access Utility from Clean Data Systems is an interesting free Access add-in with some unique data-manipulation features.

Free Data Models from DatabaseAnswers.com. A whole heap of database designs for many and varied business and consumer applications.

 Code Samples

Useful API Functions

Copy and paste into a new Access module:

Option Compare Database
Option Explicit

'This prevents screen redraw. It's especially handy
'when using OLE automation.

Declare Function LockWindowUpdate Lib "user32" _
(ByVal hwndLock As Long) As Long

'This is a custom Declare statement that uses the FindWindow API call
'to find a window of the specified class. Pass a long NULL pointer
'for the window name.
Declare Function FindWindowByClass Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As Long) As Long

'API Function that Points to a RECT structure that receives the screen
'co-ordinates of the upper-left and lower-right corners of a window.
Private Declare Function GetWindowRect Lib "user32" _
(ByVal hwnd As Long, lpRect As RECT) As Long

Private Type RECT

Left As Long
Top As Long
Right As Long
Bottom As Long

End Type

'API Function to get Screen Resolution
Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Integer) As Integer

Public Function fnGetApplicationWindowHeight() As Long

Dim hwnd As Long
Dim lngRetVal As Long
Dim hwndPrevious As Long

'Get the handle to this Access window.
hwnd = FindWindowByClass("OMain", 0&)

Dim Rec As RECT

'API uses pixels
' Get Left, Right, Top and Bottom of Access Application Window

GetWindowRect hwnd, Rec

fnGetApplicationWindowHeight = Rec.Bottom - Rec.Top

End Function

Public Function IsVGA() As Boolean

Dim xRes As Integer
Dim yRes As Integer

IsVGA= False

xRes = GetSystemMetrics(0)
yRes = GetSystemMetrics(1)

If xRes < 800 And yRes < 600 Then ' is vga
IsVGA= True
Else
IsVGA= False
End If

End Function

Public Function fnEcho(intFlag As Integer)

Dim hwnd As Long
Dim lngRetVal As Long
Dim hwndPrevious As Long

Select Case intFlag

'Echo OFF
Case 0
'Get the handle to this Access window
hwnd = FindWindowByClass("OMain", 0&)

'Prevent updates to this window
lngRetVal = LockWindowUpdate(hwnd)

'Echo ON
Case 1
lngRetVal = LockWindowUpdate(0&)

End Select

End Function

 

 Useful links
 
SQLCourse - Interactive Online SQL Training for Beginners

Happy Anniversary Microsoft Access!

Microsoft Office Template Gallery Categories

Access Developer Center
 
MS Access Help Pages
 
ADRA - Access Developer Resource Archive
 
Access FAQ
 
Mile50.com
 
MS Access 97 Help Guide
 
Trevor's MS Access FAQ
 
Access Users Group
 
 Coming soon...

A new version of the Project Management database
Incorporating daily time management

Updates of FreeAccess AddIns

Also on the drawingboard:
Instant Invoicer Wizard
Consolidation Query Wizard
Currency Exposure Manager Database

 

- Back Issues

 

Download a Searchable Compendium of Issues 1-12  

Other Access Newsletters:

Access Unlimited
by Garry Robinson
http://www.vb123.com
  Access Developer News
by Mike Gunderloy
http://www.larkware.com
Top

Top

 
CONTENTS:
What's New
Tips
Downloads
Code Samples
Useful links
Coming soon...
Back Issues

Subscription to this newsletter is free.

This newsletter may contain links to sites on the Internet which are owned and operated by third parties. AAD CONSULTING is not responsible for the content of any such third-party site.

Any files are provided "as is", without warranty of any kind. AAD CONSULTING does not assume any liability for use or the consequences of use.

To unsubscribe from this mailing list, enter your email address and click OK:

Have questions or comments?
Send them to us.

Access is a trademark of Microsoft Corporation.

©2001-2002
Anthony D'Ambra.
All rights reserved.

Top