Access Samples

Encrypt/Decrypt a value sample This sample shows a way you can encrypt and decrypta value, for storing sensitive data.
Simple junction table sample This sample shows how to use a junction tablefor a one-to-many or many-to-many situation.
Save and load listbox selections This sample shows how you can save multi-select listbox selections so that when the form opens it has those selections already made.
Open Form to Record Displayed on the First Form This sample shows how you can open a form, for example an Orders Details form, to the record number (OrderID) on the first form.
Store Multiple Data This sample shows you how you don’t need to use “spreadsheet thinking” when you have data that is different for different people, places, etc. You can store, using RECORDS, and not FIELDS, the different data. This will make queries easier to get the data you desire.
Save User Preferences Sample where you can save things like window size, form color, etc. Then the user can have their settings back when reopening the database.
Sample Ebay Fee database Sample Ebay Fee database where you can define the rules for the fees (up to 3 levels) and the code will calculate based on the rules you have entered in the main and subtable.
IncludeExtra Fields in Combo Rowsource to Fillin Other Text Boxes You canpopulate other controls by using the combo, or listbox’s rowsource.
Add Total Text Box on Main Form for Totals on Subform Many times you may want to have a total shown on a main form that is from a subform. This sample will show you how to do it.
Load Subforms at Runtime (save initial loading speed of main form) With several subforms you can find your program running very slow. So, learn how to load the subforms right when you need them.
Simple, 1 Combo Box Sample Here is a simple combo box sample. This shows how you use a combo box to save the values into the table.
Open Generic Report with Various Criteria (simple sample) Instead of creating multiple reports, create a generic report and use criteria to open what you want. See here for several different ways to open the same report but get different reports.
Cascading Combo Sample Here is a cascading combo sample. When you select one value from one of the combo boxes, your other combo is limited to what fits with the selected item in the first combo.
Mileage Sample with Effective Dates Here is a way to keep mileage reimbursement data so that you don’t have to store the reimbursement rate within the main data. You can calculate it based on “effective date.”
Open Report with Multiple Criteria (combo boxes, dates, or both) Here is a sample which will show you how to open a report with multiple criteria. This one uses a combo selection and a “to” and “from” date. You can enter one, two, or all three.
Report opened by form with date parameters This shows you how to open a report based on date selection.
Simple Login Sample This is a very simple login sample which lets you determine if someone has logged in correctly and then base what you do on what security level your user has.
Listbox with all reports in database (if named with rpt_ as prefix) This shows you how you can automatically list all reports in the database (without having to add them to a table) just by naming them with a prefix. The sample uses a prefix of rpt_ and then when you add a new report to the database, it automatically will show up in the list. Double clicking the list will open the report.
Listbox with all queries in database (if named with qry_ as prefix) Same as the report one listed above, but with queries instead of reports.
Expiration Date Sample (with multiple expiration types allowed – quarterly, monthly, etc.) Sample to show you how you can bring up a report for expirations without having to store the expiration date.