Access Tip of the Day


Execute code statements based on Access version (97/2000/2002)


If you have to design applications for an environment that supports multiple versions of Access, you may find yourself coding to the lowest version being used. Unfortunately, that can prevent you from taking advantage of newer features. Instead of writing off new functionality altogether, you can create code that runs only if the appropriate version of Access is being used. To do so, use the SysCmd method to check the version number. For instance, let's say that you want Access 2002 users (version 10) to be able to click a button and display a form in PivotTable view, which isn't available in earlier versions. By adding code like the following to the button's Click event procedure:

If SysCmd(acSysCmdAccessVer) <= 9 Then
MsgBox "This form requires Access 2002 (XP).", vbOKOnly
Exit Sub
End If

you can easily notify Access 2000 users that they aren't able to work with the form.



(Content provided by Element K Journals)


(Note: Your browser is set to refuse cookies. As a result, you may frequently see previously-viewed tips)
 
PrintPrint CloseClose

Copyright © 2001 - 2025 MJ Technologies, LLC.  All rights reserved.