If you have visited before and want to refresh to be sure you see the latest, press Ctrl-F5 on a PC.
VBA |
|||
Get Computer Name |
Get the computer name using a Windows API (application programming interface) function. | String | s4p |
Sleep |
Pause executing VBA to let something else happen, like wait for a form to close, or something external like Transfer Spreadsheet from Excel, or copy and move files. Better to Sleep than to loop DoEvents. | s4p | |
Set Application Title |
Set the application title to a specified string. Easily show the path and filename of the database when it is opened using the AutoExec macro to run a function. | Boolean | s4p |
Clear List |
Clear the selection of a listbox control | s4p | |
Drop down |
Drop the list of a combo box control. | s4p | |
Create Table and Make records |
Create a table if it doesn't already exist, define a field, make a PrimaryKey index, and put records in. This example builds a table for storing sequential numbers that can be used for printing multiple copies of a report, getting records for every day even if there is no data, finding gaps, ... useful for all kinds of things! | s4p | |
Import Excel Worksheets |
Open an Excel workbook, loop through its sheets, and write data to a table. This makes it easy to summarize, forecast, slice and dice, make charts, and calculate metrics. | s4p | |
Read Text File |
Open a text file and assign its contents to a string that is returned. | String | s4p |
Loop and Rename |
Loop through a folder of files and rename them to include date and time -- especially nice for those hundreds of pictures! | s4p | |
Save String as a File |
Create or modify a file whose contents is the text you specify. | s4p | |
Filter a Form
|
Filter a form, or a subform, or another form. Build a criteria string that only considers what is filled. Turn the form filter on or off. | s4p | |
Find a Record |
Find a Record. Often called on AfterUpdate event of Combo Box. | s4p | |
Go to First |
Go to the first record on a form. | Byte (not used) | s4p |
Go to Last |
Go to the last record on a form. | Byte (not used) | s4p |
Go to Next |
Go to the next record on a form. | Byte (not used) | s4p |
Go to Previous |
Go to the previous record on a form. | Byte (not used) | s4p |
Get Age |
Age in years given a date of birth. Optionally, specify date to calculate age as of. | Integer | s4p |
Get Distance |
Distance in miles, kilometers, or nautical miles from two points of Latutude and Longitude | Double | s4p |
Get Long Integer From String |
Get whole number from a string with other characters. | Long | s4p |
Get Nth Word |
Get the Nth word in a string. | String | s4p |
ProperCase lowercase UPPERCASE |
Convert a string to ProperCase, lowercase, or UPPERCASE ... in expressions and VBA. Use built-in functions StrConv, UCase, LCase, or a custom function (user-defined function --UDF), to make more adjustments depending on what you need. | String | s4p |
Close open Modules |
Close open standard modules. Optionally keep a module open by passing a module name or determining the active module (default), or close them all. Specify whether to save now, not save, or prompt (default) to save later. This is especially nice for developers so you can then open just what you want to focus on, switch faster, and realistically tile windows. | Integer (and String) | s4p |
Drop a table |
Delete a table using an SQL statement with DROP TABLE. Optionally, specify another database (default is current database). | s4p | |
Loop and Trim Text |
Loop through all the tables and fields. Trim leading and trailing spaces from text by constructing and running SQL for an update query to Trim. Optionally, then also replace ZLS ("") with Null. This helps data compare and sort better. | s4p | |
VBA in Access download |
|||
Highlight Current Record |
Make it easier to see the current record on your Microsoft Access continuous or datasheet forms by adding a yellow highlight behind the current record. Uses Conditional Formatting, a control to keep track of the primary key value, a control to change color, and some VBA. See how to do it in a sample database you can download, and watch the video tutorial. | s4p |