Code Snippets
+ Tips
Tips To Help You With Microsoft Access
Convert the Switch Function to a TRANSACT-SQL CASE Expression
Switch In Microsoft Access, there is a Switch function that can be used in SQL statements to evaluate a list of expressions and return a value. For example: Switch([BrakePad] = "1","OK",[BrakePad]="2","Needs Adj.",[BrakePad]="3","Bad") As Brake The expressions come...
Fill a Table with Control Info from All Forms and Reports
During the design process in a Microsoft Access database, you may need to find where a particular label Caption is being used. Or perhaps you need to compare the Row Source of combo boxes across multiple forms. The VBA functions below provide a way to capture some...
List Ascii Codes for All Characters in a Value
When manually copying data from a document and pasting into a Microsoft Access data entry form, it is possible to accidentally include unwanted characters, like Tab or other hidden characters. This may make the data hard to retrieve in a query, and a Find or Search...
Automatically Add Controls to a Form Using Table Fields
In a recent project, I needed to create a Microsoft Access datasheet form based on a table with a lot of fields. If I used the form wizard, there would be more text boxes than would easily fit on the form. The manual solution was to drag a set of fields from the...
Over 100 Examples of How Businesses Use Microsoft Access – Part 7
What is Microsoft Access? Microsoft Access is a powerful and affordable database platform that provides user-friendly data entry forms, data analysis (as complex as you would like), customizable reporting, and integration with other Microsoft products. You have...
Over 100 Examples of How Businesses Use Microsoft Access – Part 6
What is Microsoft Access? Microsoft Access is a powerful and affordable database platform that provides user-friendly data entry forms, data analysis (as complex as you would like), customizable reporting, and integration with other Microsoft products. You have...
Over 100 Examples of How Businesses Use Microsoft Access – Part 5
What is Microsoft Access? Microsoft Access is a powerful and affordable database platform that provides user-friendly data entry forms, data analysis (as complex as you would like), customizable reporting, and integration with other Microsoft products. You have...
Over 100 Examples of How Businesses Use Microsoft Access – Part 4
What is Microsoft Access? Microsoft Access is a powerful and affordable database platform that provides user-friendly data entry forms, data analysis (as complex as you would like), customizable reporting, and integration with other Microsoft products. You have...
Over 100 Examples of How Businesses Use Microsoft Access – Part 3
What is Microsoft Access? Microsoft Access is a powerful and affordable database platform that provides user-friendly data entry forms, data analysis (as complex as you would like), customizable reporting, and integration with other Microsoft products. You have...
Over 100 Examples of How Businesses Use Microsoft Access – Part 2
What is Microsoft Access? Microsoft Access is a powerful and affordable database platform that provides user-friendly data entry forms, data analysis (as complex as you would like), customizable reporting, and integration with other Microsoft products. You have...
Over 100 Examples of How Businesses Use Microsoft Access – Part 1
What is Microsoft Access? Microsoft Access is a powerful and affordable database platform that provides user-friendly data entry forms, data analysis (as complex as you would like), customizable reporting, and integration with other Microsoft products. You have...
Build a One-Line Address or Mailing Address using VBA
This VBA function allow you to create a one-line address, or a mailing address, by passing it pieces of the address and a constant. Here is an example of calling the function in the Immediate window for a one-line address, and the results. You must use a Null or blank...
Get a list of form controls sorted by tab order
Determine if a value is in a VBA array
This function will return a True if a particular value is found in an array. It works with one-dimension arrays only. For example, if astrCity is an array, you could check for the value Chicago like this: If InArray(astrCity, “Chicago”) Then ' Run logic here. End If...
How to time VBA procedures and create a log of elapsed time
This set of functions will let you track how long it took for one or more pieces of VBA code to run. The logic includes three sections: name and initialize the timer, end the timer, and write the results to a log file. Here is an example of timing part of the...
Get total hours and minutes from summing columns of Hours and Minutes
This function can be used to return total hours or total minutes from a column of Hours and a column of Minute values. For example, in the table below, an Hours value was captured separately from a Minutes value in a time clock application. If the columns are just...
Use VBA to add days to a date but exclude Saturday and Sunday
This function finds a date that is a certain number of days from a start date, when weekends are not included. It can be used when your work week does not include Saturday and Sunday and you want to find a business day in the future. Microsoft Excel provides the...
“Folder In Use” Error After Using DoCmd.OutputTo for PDF Export
I got a “Folder In Use” error after using a loop that included the DoCmd.OutputTo macro action to export a Microsoft Access report to PDF files. The error occurred when I tried to rename the folder that the PDF files were exported to. Using the DoCmd.OutputTo created...
How to use VBA to minimize the Office 2007 Ribbon
If you've ever wished you could keep the Office Ribbon, but automatically minimize it to conserve space, this VBA function is for you. The same technique works for Microsoft Access, Microsoft Word, etc. The function includes two pieces of logic. The first piece...
Making Microsoft Access Work
No matter what your MS Access needs are, Carl can provide live help to make sure you get the solution you need.