├── Access_Example_VBA.accdb ├── Images └── ReadMe │ └── App.png ├── LICENSE ├── README.md └── text.vb /Access_Example_VBA.accdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Access-projects/Access-examples/d0ffd681d431f38d91c138559763c30df0699c55/Access_Example_VBA.accdb -------------------------------------------------------------------------------- /Images/ReadMe/App.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Access-projects/Access-examples/d0ffd681d431f38d91c138559763c30df0699c55/Images/ReadMe/App.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Anthony Duguid 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | # Microsoft Access Examples 6 | Various examples of VBA, queries, macros, forms, reports and ribbon XML in an Microsoft Access database file 7 | 8 | 9 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE "MIT License Copyright © Anthony Duguid") 10 | ![current_build Office_2016](https://img.shields.io/badge/current_build-Office_2016-red.svg) 11 | [![Latest Release](https://img.shields.io/github/release/Access-projects/Access-examples.svg?label=latest%20release)](https://github.com/Access-projects/Access-examples/releases) 12 | [![Github commits (since latest release)](https://img.shields.io/github/commits-since/Access-projects/Access-examples/latest.svg)](https://github.com/Access-projects/Access-examples/commits/master) 13 | [![GitHub issues](https://img.shields.io/github/issues/Access-projects/Access-examples.svg)](https://github.com/Access-projects/Access-examples/issues) 14 | 15 | 16 | ## Table of Contents 17 | - References 18 | - Command Line Options 19 | - Object Listing Reference 20 | 21 | 22 | ### References 23 | |Link |Type | 24 | |:-------------------------------|:--------------------------| 25 | |[Microsoft Access Find & Replace Add-in](http://www.rickworld.com/products.html)|Software| 26 | |[Microsoft Access Merge & Diff](http://www.accdbmerge.net/download)|Software| 27 | |[O'Reilly Access Database Design & Programming, 3rd Edition](http://shop.oreilly.com/product/9780596002732.do)|Book| 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 96 | 97 | 98 | 99 | 100 | 101 |
34 |

35 | Command Line Options 36 |

37 |
OPTIONDESCRIPTION
/decompileUndocumented command line. Will sometimes remove old code and objects from the database and make it faster.
/exclOpens the specified Access database for exclusive access. To open the database for shared access in a multiuser environment, omit this option. Applies to Access databases only.
/roOpens the specified Access database or Access project for read-only access.
/user user nameStarts Access by using the specified user name. Applies to Access databases only.
/pwd passwordStarts Access by using the specified password. Applies to Access databases only.
/profile user profileStarts Access by using the options in the specified user profile instead of the standard Windows Registry settings created when you installed Microsoft Access. This replaces the /ini option used in versions of Microsoft Access prior to Access 97 to specif
/compact target database or target Access projectCompacts and repairs the Access database, or compacts the Access project that was specified before the /compact option, and then closes Access. If you omit a target file name following the /compact option, the file is compacted to the original name and fo
/repairRepairs the Access database that was specified before the /repair option, and then closes Microsoft Access. In Microsoft Access 2000 or later, compact and repair functionality is combined under /compact. The /repair option is supported for backward compat
/convert target databaseConverts a previous-version Access database or Access project to the default file format, renames the new file, and then closes Access. You must specify the source database before you use the /convert option. To view the default file format, click Options
/x macroStarts Access and runs the specified macro. Another way to run a macro when you open a database is to use an AutoExec macro.
/cmdSpecifies that what follows on the command line is the value that will be returned by the Command function. This option must be the last option on the command line. You can use a semicolon (;) as an alternative to /cmd. 85 | Use this option to specify a comma
/nostartupStarts Access without displaying the task pane (the second dialog box that you see when you start Access).
/wrkgrp workgroup information fileStarts Access by using the specified workgroup information file. Applies to Access databases only. 94 | 95 | C:\Program Files\Access 2K Runtime\Office\MSACCESS.EXE P:\general\Database\Facilities_Management_System\v_11_1\FMS.mde /user username /pwd /wrkgrp P:\gene
/runtimeStarts Access in runtime mode for testing. C:\Program Files\Office\MSACCESS.EXE C:\Database\database.mde /runtime
102 |
103 | 104 |
105 |
106 |
107 | 108 | 109 | 110 | 111 | 112 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 |
113 |

114 | Object Listing Reference 115 |

116 |
TypeNbrNameDescriptionItems
Form (-32768)
1001_About_frmA description of the Microsoft Access Database.
2002_Splash_Screen_frmA splash screen with the company logo and the application information.
3003_Buttons_frmCommand Button example with code
4004_DSN_Password_frmA form to login to a DSN database connection
5005_Access_Security_frmAllow the user to login, change password, edit permission; where granted, and view list of current users.
6006_Dialogbox_Examples_frmDialog box examples
7010_Date_Calendar_frmUses the calendar dll from Microsoft (only needed previous to 2007)
8301_Roulette_frmRoulette game
9700_Create_Filelist_frmRecursive code to go through complete folder structure and catalog a file list
10800_Link_Manager_frmManage the links from server objects
11900_Check_Runtime_frmCheck performance of queries and reports
12950_Leszynski_Conventions_frmLeszynski Naming Conventions for Microsoft Solution Developers
13980_Data_Dictionary_frmA form that documents the columns, column descriptions, and the rest of the attributes of each table within the database whether the table is a Access or Server based.
Macro (-32766)
1AutoKeysHot Key designation
2RibbonAccess 2007-2016 Ribbon example
Report (-32764)
1001_Organization_Logo_srpPrimary company logo.
2099_Object_Listing_Report_rptA listing of all the objects within the database
3803_Object_Calendar_List_rptA calendar style report
4803a_Calendar_List_srpA sub-report to 803_Object_Calendar_List_rpt
5804_Weekly_Report_rptA 52 week style report
6805_Timeline_Report_rptA MS Project like time line report example
7950_Leszynski_Conventions_rptLeszynski Naming Conventions for Microsoft Solution Developers
8980_Data_Dictionary_rptA data dictionary listing of all the tables in this database
Module (-32761)
1clsMonthCalCalendar ClassCreateDTPControl 340 |
341 | ReDraw 342 |
343 | MultiSelect 344 |
345 | MaxSelectRangeofDays 346 |
347 | CalendarYOffset 348 |
349 | MonthRows 350 |
351 | MonthColumns 352 |
353 | WindowLocation 354 |
355 | PositionAtCursor 356 |
357 | CursorXinit 358 |
359 | CursorX 360 |
361 | CursorY 362 |
363 | FontSize 364 |
365 | FontName 366 |
367 | ShowWeekNumbers 368 |
369 | NoTodayCircle 370 |
371 | NoToday 372 |
373 | hwnd 374 | hWndForm 375 |
376 | hWndCal 377 |
378 | OneClick 379 |
380 | SelectedDate 381 |
382 | SetSelectedDateRange 383 |
384 | StartSelectedDate 385 |
386 | EndSelectedDate 387 |
388 | GetSelectedDates 389 |
390 | SetViewableMonths 391 |
392 | SetBoldDayState 393 |
394 | Class_Initialize 395 |
396 | Class_Terminate 397 |
398 | GetProperty 399 |
400 | SetProperty 401 |
402 | IsCalendar 403 |
2modCalendarCalendar FunctionsShowMonthCalendar 411 |
412 | WindowProc 413 |
414 | GetFuncPtr 415 |
416 | SetSelectedDate 417 |
418 | SetMonths 419 |
420 | sClick 421 |
422 | ShowWeekNums 423 |
424 | sShowToday 425 |
426 | sShowcircleToday 427 |
428 | sWindowPosition 429 |
430 | UpdateCursor 431 |
432 | LocationCursorOnCalendar 433 |
434 | ReleaseClass 435 |
436 | LoWord 437 |
438 | MakeDWord 439 |
3modDateDate functionsTimedelay 447 |
448 | DaysInMonth 449 |
450 | Age 451 |
452 | DaysInMonthMS 453 |
454 | DaysInMonth2 455 |
456 | EndOfMonth 457 |
458 | EndOfWeek 459 |
460 | FormatInterval 461 |
462 | LastBusDay 463 |
464 | LeapYear2 465 |
466 | NextDay 467 |
468 | NextDay1 469 |
470 | Num2Date 471 |
472 | PriorDay 473 |
474 | PriorDay1 475 |
476 | StartOfMonth 477 |
478 | StartOfWeek 479 |
480 | String2Date 481 |
482 | WorkDays 483 |
4modFileFunctionsContains procedures that check and refresh the links to Northwind tables.RefreshLinks 491 |
492 | GetDirectory 493 |
494 | FindFile 495 |
496 | ReturnAllFiles 497 |
498 | RecursiveDir 499 |
500 | TrailingSlash 501 |
502 | MSA_CreateFilterString 503 |
504 | MSA_ConvertFilterString 505 |
506 | MSA_GetSaveFileName 507 |
508 | MSA_SimpleGetSaveFileName 509 |
510 | MSA_GetOpenFileName 511 |
512 | MSA_SimpleGetOpenFileName 513 |
514 | OF_to_MSAOF 515 |
516 | MSAOF_to_OF 517 |
5modMainSubroutines that run objects and procedures in the databaseOSUserID 525 |
526 | ErrorMsg 527 |
528 | GetObjectDescription 529 |
530 | GetObjectTypeName 531 |
6modMathAreaVolumeArea and VolumeACircle 539 |
540 | ARect 541 |
542 | ARing 543 |
544 | ASphere 545 |
546 | ASquare 547 |
548 | ASquare2 549 |
550 | ATrap 551 |
552 | ATriangle2 553 |
554 | RectDiag 555 |
556 | SquareDiag 557 |
558 | VCone 559 |
560 | VCylinder 561 |
562 | VPipe 563 |
564 | VPyramid 565 |
566 | VTruncPyramid 567 |
7modMathCumulativeCumulative ValueCumulativeValue 575 |
576 | DeCumulativeValue 577 |
8modMathStatisticsStatisticsCombin 585 |
586 | Factorial 587 |
588 | FactorialR 589 |
590 | Permut 591 |
592 | Regress 593 |
594 | TestRegress 595 |
9modMathTrigTrigonometryArcCos 603 |
604 | Arccosec 605 |
606 | Arccotan 607 |
608 | ArcSec 609 |
610 | ArcSin 611 |
612 | ATan2 613 |
614 | Cotan 615 |
616 | Deg2Rad 617 |
618 | HArccos 619 |
620 | HArccosec 621 |
622 | HArcsec 623 |
624 | HArcsin 625 |
626 | HArctan 627 |
628 | HCos 629 |
630 | HCosec 631 |
632 | HSec 633 |
634 | HSin 635 |
636 | HTan 637 |
638 | pi 639 |
640 | Rad2Deg 641 |
642 | Sec 643 |
10modMathXYZLatitude/LongitudeDegToDMS 651 |
652 | DegToDMSStr 653 |
654 | DMSStrToDeg 655 |
656 | DMSToDeg 657 |
658 | GreatArcDistance 659 |
660 | LatLongToXYZ 661 |
662 | testxyz 663 |
664 | XYZToLatLong 665 |
11modOutlookMicrosoft Outlook FunctionsImportContactsFromOutlook 673 |
674 | ImportCalendarFromOutlook 675 |
676 | PushAppointments 677 |
12modStringString Manipulation/ParsingLowerCC 685 |
686 | ParseCSZ 687 |
688 | ParseName 689 |
690 | Proper 691 |
692 | ProperEx 693 |
694 | ProperWord 695 |
696 | StrToHex 697 |
698 | TestParseName 699 |
700 | UpperCC 701 |
702 | CountCSVWords 703 |
704 | CountWords 705 |
706 | CutFirstWord 707 |
708 | CutLastWord 709 |
710 | ReplaceStr 711 |
712 | GetCSVWord 713 |
714 | GetWord 715 |
716 | Like2 717 |
718 | LPad 719 |
720 | ParseItemsToArray 721 |
722 | RPad 723 |
724 | ParseArticle 725 |
Access Table (1)
1CMD_LINE_TBCommand line options for Access
2CUM_VAL_TBUsed to test the function in modMathCumulative
3DATABASE_STRUCTURE_TBUsed to store the database table structure
4DECUM_VAL_TBUsed to test the function in modMathCumulative
5ROULETTE_TBNumbers for roulette
6TAG_GRP_TBLeszynski Naming Conventions for Microsoft Solution Developers
7TAG_NME_TBLeszynski Naming Conventions for Microsoft Solution Developers
8tblContactsUsed with the Microsoft Outlook Functions
9tblDefaultsUsed to store defaults used in the this database
10tblFileListUsed to store a list of files
11USysRibbonsMicrosoft Access Ribbon XML example
Query (5)
1101_Object_List_qryCreates a list of all objects in the MS Access database (Needs module modMain)
2200_Create_DATABASE_STRUCTURE_TB_qryUsed to create the MS Access table using DDL
3201_Create_DATABASE_STRUCTURE_TB_qryUsed to create the MS Access table using DDL
4202_Add_Constraint_pk001_Primary_Key_PROP_ID_qryUsed to add a constraint to a MS Access table using DDL
5203_Add_Column_LST_MDFD_ID_qryUsed to add a new column to a MS Access table using DDL
6204_Alter_Column_LST_MDFD_ID_qryUsed to alter a column in a MS Access table using DDL
7205_Drop_DATABASE_STRUCTURE_TB_qryUsed to drop a MS Access table using DDL
8720_Cumulative_Value_qryUsed to test the function in modMathCumulative
9721_Decumulative_Value_qryUsed to test the function in modMathCumulative
10803_Calendar_Style_Listing_qryUsed in the report 803_Object_Calendar_List_rpt
11803a_Calendar_List_qryUsed in the sub-report 803a_Calendar_List_srp
12804_Weekly_Report_qryUsed in the report 804_Weekly_Report
13940_Date_Format_qryExamples of formating date & time
14950_Leszynski_Conventions_qryLeszynski Naming Conventions for Microsoft Solution Developers
15SQL_Server_Function_Login_Name_qrySQL Server pass-through query
16SQL_Server_View_Date_Time_qrySQL Server pass-through query
946 |
947 | 948 | -------------------------------------------------------------------------------- /text.vb: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------