Ken's Sample db's (1 Viewer)

Status
Not open for further replies.

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Ken's Sample dbs

Sample db using conditional formatting with a boolean (yes/no) field. (Access 2002-2003 format and '97 format)
 

Attachments

  • Cndfrmt.zip
    9.6 KB · Views: 8,286
  • CndFrmt97.zip
    10.7 KB · Views: 3,258
Last edited:

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Sample db using using a list box to build a sql statement to use as a recordsource for a subform. (Access 2002-2003 format)
 

Attachments

  • LstbxCriteria.zip
    24.6 KB · Views: 4,749
  • LstbxCriteria97.zip
    8.2 KB · Views: 1,542
Last edited:

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Sample db using the running sum feature. (Access 2002-2003 format)
 

Attachments

  • Rnsum.zip
    8.6 KB · Views: 4,007
Last edited:

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Sample db with a simple function. (Access 2002-2003 format)
 

Attachments

  • SimpleFunction.zip
    9.9 KB · Views: 5,165

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Sample db takes common data and consolidates it into a single field. (Access 2002-2003 format)
 

Attachments

  • Consolidate.zip
    17.1 KB · Views: 3,836
Last edited:

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Sample db using using a popup form to enter date range for a report and display this date range on the report. (Access 2002-2003 format)
 

Attachments

  • rprtwithdates.zip
    17.5 KB · Views: 4,244

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
This illustration shows one of the main upsides to using SQL Server (or other database sever), as a back-end to an Access front-end:
 

Attachments

  • sqlservervsfileserver.gif
    sqlservervsfileserver.gif
    25.1 KB · Views: 4,201
Last edited:

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Sample db that returns focus to the original control after the secondary control executes code. (Access 2002-2003 format)
 

Attachments

  • Returntocntrl.zip
    13.7 KB · Views: 3,038

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Sample db uses a combo box to filter records in a form. (Access 2002-2003 format and Access 97 format)
 

Attachments

  • ComboBoxAsCriteria.zip
    17.1 KB · Views: 4,491
  • ComboBoxAsCriteria97.zip
    6.1 KB · Views: 1,508

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Task DB

Here's a older version of a db I did - Was wondering if anyone had any suggestions / ideas on how to improve / add functionality to it... I know the project form needs work and and the 'tag' bit is unfinished... Any other ideas?
 

Attachments

  • Tasks.zip
    109.9 KB · Views: 3,734

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Sample database with a form and subform and their associated one to many tables (Access 2002-2003 format and Access 97 format).
 

Attachments

  • FormSubForm.zip
    15.4 KB · Views: 3,498
  • FormSubForm97.zip
    6.9 KB · Views: 1,195

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Access Tip 1: Default Values

To set the default values for controls, select the control on the tool bar and press F4. The default value properties list will appear. I like to turn off all of the 3D stuff by resetting some the values like 'Special Effect', 'Border Style', etc. This way I don't have to manually change them after the fact...

 

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Adding 'All' option to combo or list box control

Sample database showing one way to add 'All' as an option to a combo or list box control (Access 2002-2003 format).

:)
ken
 

Attachments

  • allCombo.zip
    13.3 KB · Views: 2,891

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Linking to table with code

Sample database with simple code linking to a table in another databse via code.
 

Attachments

  • Link_test.zip
    52.5 KB · Views: 2,904

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Front-End Token

When I set up an MS Access database in a multi-user environment and need to have a front-end on each client I will deploy the application with 3 basic .mde files. The first is the back-end file copied to the server which contains all of the data tables. The second is the master front-end file and is also copied to the server. I refer to this file as ‘master’ front-end because it is not executed but is copied to the client’s local workstation when the database is first deployed and when a new version of the front-end needs to be distributed. The third file is what I refer to as the front-end ‘loader’. This is the file that the end user runs on their local workstation when they want to open the database. As far as they know this loader file is the actual database. I usually email them the loader file which they save to their desktop.

The first time the user executes the loader file it copies the master front-end to the local workstation, launches the local copy of the front-end and closes itself. The next time the user wants to open the database, providing there is not a newer version of the front-end available on the server, the loader file skips the step where it copies the master front-end over to the local workstation and simply opens the local front-end and closes itself.

The final scenario is where a new version of the master front-end needs to be deployed and has been copied to the server. The master front-end, and hence the local copy of the front-end, has been set up with a database variable that I refer to as the front-end version number. When a new version of the front-end is ready to be deployed I change the master front-end database version variable and copy it to the server deleting the older version.

Now when the user wants to run the database, they execute the loader file, it compares the front-end version numbers in the local and the master front-end files. When it finds they are different it replaces the older local version with the newer master version. Then again, it executes the local front-end and closes itself.

All of this is pretty standard but here's the problem; What if the user tries to open the local front-end file directly? None of the version checking routines will execute and the user will continue to run the older version of the front-end!

To overcome this I pass a token from the loader file to the front-end that must be validated in order for the front-end to open. If the user tries to run the front-end directly, the token will be absent and the front-end will not open.

In the loader file I use the command line option '/cmd' in the shell() function to pass the token to the front-end. When the front end opens, it checks the token with the complementary command() function. If it fails to receive the proper token, the front-end advises the user of the error and closes.

Code

In the loader, after the version checking routines have executed, the code that opens the front-end looks something like following:

Code:
strMSAccessAPP = "C:\Program Files\Microsoft Office\Office11\MSACCESS.exe"
strClientFEFile = "C:\LocalFiles\FE.mdb"
strFEToken = "MyTokenValue"

strCommandLine = strMSAccessAPP & " /cmd """ & strFEToken & """" & " " & """" & strClientFEFile & """"

intX = Shell(strCommandLine)

In the front-end the code that checks the token looks something like:
Code:
If IsNull(Command) Or Command <> "MyTokenValue" Then
   MsgBox "This database cannot be opened directly!"
   Quit
End If

Of course the front-end and loader files need to have the shift key disabled and be compiled into .mde files to protect the token.

--Note-------------------
I have included sample front-end and loader files. All that you should have to do is copy them into a folder and go into the loader file (holding the shift key down so that you get to the code), and change the string vars to your file locations. When you open the loader it should open the FE. If you try to open the FE by itself it should error and close. Or if you change the token value it should error and close...
 

Attachments

  • FEToken.zip
    29.5 KB · Views: 1,649
Last edited:

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Passing a string value to a form or report when it opens

The following database (2003), demonstrates how to pass a value to a form or report when it opens by using the forms openargs property.
 

Attachments

  • open_args.zip
    24.7 KB · Views: 1,789

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Custom Security

Sample database with basic custom security objects (Access 2002-2003 format).

(User name: John Doe, Password: password)
 

Attachments

  • CustomSecurity.zip
    47.7 KB · Views: 2,141
Last edited:

KenHigg

Registered User
Local time
Today, 11:04
Joined
Jun 9, 2004
Messages
13,327
Disable Shift Key

Sample db with example of how to disable the shift key when the database opens. (Access 2002-2003 format)
 

Attachments

  • DisableShiftKey.zip
    20.1 KB · Views: 1,436
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom