Access: Office-constants

by Olaf Rabbachin 30. April 2006 22:18

If you have to do Office-automation in larger corporations, there'll probably be more than one Office-version. As a consequence, you won't be able to use early binding in order to support all (compatible) Office-versions being used. Hence, you'll neither be able to use the constants provided by the respective application. The work-around is to provide these constants yourself.
This demo contains modules for the most commonly targetted Office-applications.

This is one of the older entries that can also be found on the original Access-site.

Download: OfficeConstants.zip (288.52 kb)


Location: PostList

Tags: ,

Access/VBA

Access: Enhancing the focus

by Olaf Rabbachin 13. August 2005 22:11

This sample database includes a ready-to-use module that may help in the user seeing right away what control on your forms currently has the focus.
Being called directly from a control's event (OnEnter/OnGotFocus resp. OnExit/OnLostFocus) using its property sheet, either its backcolor may be set or a colored rectangle may be drawn around it (i.e. if its backcolor may not be set).

This is one of the older entries that can also be found on the original Access-site.

Download: FocusEnhancer.zip (24.57 kb)


Location: PostList

Tags:

Access/VBA

Access: A TreeView-Switchboard

by Olaf Rabbachin 10. August 2005 21:56

This sample database implements a switchboard-solution that uses a treeview-control that itself will allow the user to navigate to your application's objects by means of a hierarchical list.
The switchboard itself also includes a subform that may host other forms that are being shown after the user clicks a node in the treeview.
The hierarchy is being created using a simple and straight-forward table where you name the nodes, set the nodes' hierarchy-level and their order of appearance; This table will also be the place where you will state what form, report or function is to be called after the user clicks a node.


Attention!
You will need the treeview-control installed on your machine. If you do not have the control, you will most probably not have the required license (included with i.e. VB6) to distribute it either. However, here's a setup that will install the treeview - so that you may at least try it out. This archive also includes the setup-script that is being used to install the control (InnoSetup-script).

This is one of the older entries that can also be found on the original Access-site.

Download: TV_Switchboard.zip (56.65 kb)


Location: PostList

Tags: , ,

Access/VBA

Access: Querying external DBs "on the fly"

by Olaf Rabbachin 8. February 2005 21:53

This sample database shows how to query an external database "on the fly", that is, without linking any table of that external database to the current one. Instead, a SQL-string will be constructed that may be used from within code or that may be passed to i.e. a combobox or listbox.
The MDB allows you to choose a database-file and will then display all tables and/or queries therein. After choosing a table or query, all records will be pushed into a listbox (if possible).
This approach is most useful i.e. in scenarios where multiple backend-databases are being used. In such cases, using queries as tables (i.e., instead of tables) and simply modifying those queries' SQL-portion after the backend-database has to be changed will be way faster than using linked tables along with TableDef.RefreshLink.

This is one of the older entries that can also be found on the original Access-site.

Download: QueryOnTheFly_A2k.zip (46.34 kb)


Location: PostList

Tags: , ,

Access/VBA

Access: Tab-Extender

by Olaf Rabbachin 18. December 2004 21:49

This demo introduces a small class that, with just a few lines of code, allows for the TAB-key to move focus between controls on different sections or containers.

This is one of the older entries that can also be found on the original Access-site.

Download: TabExtender_A2K_AXP.zip (33.71 kb)


Location: PostList

Tags: , , ,

Access/VBA

Access: Network-Monitor

by Olaf Rabbachin 9. August 2004 21:46

Reading an Access-lockfile (*.ldb) you may determine which users (with their computer-names) are connected to a given Access backend-database.
However, information obtained this way isn't really precise, as i.e. a user may have failed to log out correctly, leaving a trace in the .LDB.
Using an ADO-recordset in conjunction with a specific schema instead will allow to create a recordset that will retrieve more exact information.
This is a sample database which comes with a form (screenshot) that you may incorporate into your own application and which will show a roster of users currently connected to a given database-backend.

This is one of the older entries that can also be found on the original Access-site.

Download: NetworkUsers.zip (72.97 kb)


Location: PostList

Tags: , , , ,

Access/VBA

Access: How to make the Access-window show your icon

by Olaf Rabbachin 19. February 2003 21:42

Access comes with the ability to set your own icon using the screen supplied under Tools/Startup.
Too bad an absolute path is required for this property called 'AppIcon', as just about always your users will install your application into a non-predictable directory, rendering your icon useless.
However, here's a sample with which you may - using just a couple of lines of code - set this property when your app's starting up.
In addition to that - if you use Access with V10 or higher (10 = Access XP) along with the Access XP file-format, this icon may be used for forms and reports as well.

This is one of the older entries that can also be found on the original Access-site.

Download: AppIcon_2K.zip (29.95 kb)


Location: PostList

Tags: ,

Access/VBA

Access: Resize-hook

by Olaf Rabbachin 30. January 2002 21:36

If you'd like to prevent a form or the access-window from being resized below a certain level, the resize-event might be what you're using. However, I bet you're encountering a lot of flickering when doing so, right? Well, the flickering is caused due to the fact that - when this event triggers - the resize-action will already have taken place - leaving you one step behind events ...
Using subclassing, this sample database hooks into the windows-messaging-system which will be fired before the new size is passed to the form's resize-event.
Also in this sample: a small module which will help retrieve twips-per-pixel ratios.

This is one of the older entries that can also be found on the original Access-site.

Download: ResizeHook.zip (41.04 kb)


Location: PostList

Tags: , ,

Access/VBA

Access: Returning values from forms; avoiding the mouse-wheel

by Olaf Rabbachin 29. January 2002 21:33

This demo-MDB introduces a module that enables you to receive multiple return-values from a form, working as wrapper for all calls to DoCmd.OpenForm().
In addition to the above this sample shows you how to avoid the nasty effects arising from the unpredictable usage of a mouse-wheel - without using any API-calls or additional DLLs.

This is one of the older entries that can also be found on the original Access-site.

Download: Form_RetVals.zip (115.75 kb)


Location: PostList

Tags: ,

Access/VBA

Access: DAO-lookup for Listbox-controls

by Olaf Rabbachin 28. January 2002 21:26

This demo-MDB shows a class that will find the first corresponding entry in (i.e.) a listbox whenever a key is tapped in. The code is encapsulated in a class for easy use in your own apps.

This is one of the older entries that can also be found on the original Access-site.

Download: DAO_Lookup_A2K.zip (54.16 kb)


Location: PostList

Tags: , ,

Access/VBA

Access: SizeToContent for continuous forms

by Olaf Rabbachin 25. January 2002 21:20

Introduces a way for smaller tables resp. amounts of queried data to be shown all together in a continuous form, i.e., without a vertical scrollbar. The form will adjust its height to show all records while removing the scrollbar - thus avoiding the display-'bug' (or just strange behaviour by design?) in conjunction with continuous forms.

This is one of the older entries that can also be found on the original Access-site.

Download: ContinuousNoScroll.zip (38.73 kb)


Location: PostList

Tags: ,

Access/VBA

Access: How to create a simple and smooth ProgressBar

by Olaf Rabbachin 5. January 2002 21:18

This demo shows how to setup a (smooth!) progressbar without any OCX or even API - simply by integrating a prepared subform and a couple of lines of code.
Just insert this sample's subform into your own form and you're ready to go.
This sample A97-mdb includes full source-code and a demo showing the use with two concurrent bars.

This is one of the older entries that can also be found on the original Access-site.

Download: ProgressBar_Demo.zip (63.71 kb)


Location: PostList

Tags: , ,

Access/VBA

Access: A replacement for the eeky InputBox

by Olaf Rabbachin 5. January 2002 21:17

Shows how to easily setup your own input-form to query a user's input instead of using the built-in inputbox [~shudder~]. All you'll need is one line of code in order to receive input from a user.
This is an A97-MDB but can easily be converted into later versions.

This is one of the older entries that can also be found on the original Access-site.

Download: UserQuery.zip (29.34 kb)


Location: PostList

Tags: ,

Access/VBA

Access: A status-message window for Access

by Olaf Rabbachin 1. January 2002 21:07

This is a sample-MDB with an easy to use class that'll allow to bring up a form displaying something like "Please hold on a moment..." plus a status-message.

All that's needed is to instantiate the class and call the class' method to send a message - especially useful where a progressbar doesn't make sense or may not be used.

This is one of the older entries that can also be found on the original Access-site.

Download: PleaseHoldOn_A2K.zip (35.10 kb)


Location: PostList

Tags: ,

Access/VBA

Access: adjustable Listbox-columns

by Olaf Rabbachin 1. January 2002 21:04

This sample shows how to automatically resize a listbox's column-widths and, while at it, adjust command-buttons (that were created in order to serve as column-headers) as well. The command-buttons implement an ORDER BY-functionality which will re-sort the listbox's contents at the matter of a mouse-click and a single line of code. This is an A97-MDB but can easily be converted into later versions.

This is one of the older entries that can also be found on the original Access-site.

Download: adjustableListboxColumns_97.zip (28.81 kb)


Location: PostList

Tags: ,

Access/VBA

Access: Obtain mouse-pointer's position relative to the Access-window

by Olaf Rabbachin 1. January 2002 20:59

This demo shows how to retrieve the current coordinates of the mouse-pointer, relative to the Access-window's position (helpful i.e. for self-defined tooltips).

This is one of the older entries that can also be found on the original Access-site.

Download: MousePos_AccessRelated.zip (40.76 kb)


Location: PostList

Tags: ,

Access/VBA

About

Hi and welcome to my blog!

I'm a developer from Germany, currently focusing on .Net and WPF.

More about me ...