The difficult I do immediately, the impossible takes a little bit longer.
Creating a Settings table...
How to use Windows System Colors (Access 2003 and earlier)
Where are the Options? (Access 2007 and higher)
Trusted Location (Access 2007 and higher)
Export Specifications (Access 2007 and higher)
Import Specifications (Access 2007 and higher)
Navigation Pane Options (Access 2007 and higher)
Option for Current Database (Access 2007 and higher)
Set Subdatasheet to None (Access 2003 and higher)
Object Designer (Access 2007 and higher)
If IsNull(Me.txtArticleID) Then
MsgBox "Nothing to do, select an Article and retry!", vbInformation, "Preview"
If DLookup("sPrintingArticles", "tblSettings") = True Then
DoCmd.OpenReport "rptArticle", acViewPreview, , "aArticleID = " & Me.txtArticleID
DoCmd.OpenReport "rptArticle", acViewPreview
A Settings table is where you let your Users define their own defaults. This comes in handy when you are distributing your database and you know everyone is not going to want the same Default.
In my example I gave the Users a chance to select if they want to print all the Articles or just the Article they are on. However, it can be used to *set* all sorts of Defaults, ie... I always allow 10% when measuring fabric but someone else may want 15%. With a Settings table the User could enter their own Default.
There are two ways to set this up. In this example I have named the field *sPrintingArticles* and set the Data Type as Yes/No. However, you can also set it up to have three fields.
With my table set up I can now use it in code as shown below...
You can download the sample database that contains this table here.