About Optic Prime

Optic Prime is a VBA module(a collection of useful functions and subs); it allows for easier developement of multi-user database applications with form configurations that look and feel more intuitive than the Access defaults that are provided. I made Optic Prime after a frustrating experience building nice-looking multi-user applications with Microsoft Access. I have created several database applcations for my work using variations of Optic Prime(built using Access 2010 on Windows 7).

F.A.Q

Who is it for?

Anyone developing Access applications for use over a network.

How do I use it over a network with other users simultaneously?

Put the .accdb file on a shared network folder and have the client machines(user computers) download Access Runtime 2010, they will be able to use the application simultaneously through runtime.

How do I avoid database corruption?

I've never experienced corrupt databases with the applications built using Optic Prime, I've heard tales from IT professionals about issues with 2007 and older versions of Access. Recommendations are to split the database after it is made, and build it as an application.

What should I know before using this module?

A moderate understanding of how Access tables, forms, and reports work. A very basic understanding of VBA (the functions and subs are documented below), you can see how everything is put together by downloading the example file.

Download


Screen Shots

simple log example Simple Entry Simple Login Simple Log with login VBA code App Navigation App log App Entry App Update VBA App Code Optic Prime


Documentation

Function/Sub name

Description and parameters of function/sub [brackets mean parameters are optional]

Example of usage.

OpenClose

Opens/closes forms ([open_form], [close_form])

OP.OpenClose("SampleLog"),("Navigation")

ExitApp

Exits the program, optional exit message ([exit_message])

OP.ExitApp("Are you sure you want to quit?")

LoginOpen

Opens a form by using a password and login username (login_control, password_control, password_table, password_field, open_form, [invalid_login_message], [invalid_password_message])

OP.LoginOpen (Me.Username), (Me.Password), ("PermissionTable"), ("PasswordField"), ("SampleLog"), ("Wrong username"), ("Wrong password")

SaveRecord

Saves a record ([open_form], [close_form], [save_message]

OP.SaveRecord ("SampleLog"),("SampleEntry"),("Transaction has been saved, thanks!")

IncrementNumber

Increments a number field (number_field, number_table, id_field, ID As String, increment_by)

OP.("DocNum"), ("NumTable"),("TroubleNum"),("ID"),(1)

EmailOutlook

Sends an email through Outlook, attachments are optional (email_to, email_subject, close_outlook,[email_body],[email_attachment])

OP.("OpticPrimeMod@gmail.com"),("Cool Subject"),(TRUE),("Here is the body of the email"),("C:\Users\Patrick\Documents\word.doc")

PrintNow

Prints form, no parameters needed.

OP.PrintNow()

PrintWordDoc

Print to Word document (file_path)

OP.PrintWordDoc("C:\Users\Patrick\Documents\")

PDF

Create PDF of Report (report_name, pdf_path, pdf_name,[ID])

OP.PDF ("RepForPDF"), ("C:\Users\" & Environ("USERNAME") & "\Documents\"), ("Ticket Report")

ExcelExport

Export query or table to Excel (xlsx_path, table_to_export, [message])

OP.ExcelExport ("C:\Users\" & Environ("USERNAME") & "\Documents\Tickets"), ("Tickets"), ("Tickets.xlxs saved in documents")

OpenList

Open a form based on a listbox record (open_form, list_control, [no_selection_message],[close_form])

OP.OpenList ("TicketUpdate"), (Me.ticketList), ("Please select a ticket...")

FilterList

Filter a query based on a control (table_query, search_control, field_lookup)

OP.FilterList ("SampleQuery"),(me.comboSearchCustomer),(me.boxID),("ID")

FilterListID

Filter a query based on ID (table_query, search_control, field_lookup, search_ID, field_ID)

OP.FilterListID("SampleQuery", Me.comboSearchCustomer, "Customer", Me.boxID, "ID")

FilterListTwo

Filter a query based on mulitple controls (table_query, search_control_1, field_lookup_1, search_control_2, field_lookup_2)

OP.FilterListTwo("TicketQuery", Me.comboSearchTicket, "Initiator", Me.comboStatus, "Status")

OpenListCondition

Open a record from a listbox based on a condition (conditional_field, criteria_of_condition, close_form, open_form, list_name, related_report)

OP.OpenListCondition ("Status"), ("Closed"),("SampleLog"),(""),(me.SampleList),("repForPDF")

CancelRecord

Cancels changes made to a record ([open_form], [close_form])

OP.CancelRecord (previousForm), (currentForm)

CheckSpelling

Check the spelling of a text control (text_field)

OP.CheckSpelling (Me.Problem)

DuplicateRecord

Duplicates current record ([message])

OP.DuplicateRecord("Record has been duplicated")

Authorize

Checks if user is authorized, can be used to open forms, change certain controls, or records that require restrictions (permission_field, user_table, user_field, not_permitted_message, permission_value)

OP.Authorize("EmployeeNumber", "PermissionTable", "UserEnvironment", "Not authorized for signing", "1")

DeleteRecord

Deletes a record ([open_form], [close_form], [verify])

OP.DeleteRecord (previousForm), (currentForm), ("Are you sure you want to delete this Ticket?")

CreateFolder

Creates a folder (new_folder_path)

OP.CreateFolder("C:\Users\Patrick\Documents\folderName")

CopyFolder

Copies a folder to new path (folder_path, copy_path)

OP.CopyFolder ("C:\Users\Patrick\Documents\folderName"), ("C:\Users\Patrick\Desktop\folderCopy")

BrowseFile

Browse for folder dialog window opens and returns selected file path

OP.BrowseFile()

BrowseFolder

Browse for folder dialog window opens and returns selected folder path

OP.BrowseFolder()

RenameFolder

(old_name, new_name)

OP.RenameFolder ("C:\Users\Patrick\Documents\folderName"),("C:\Users\Patrick\Documents\NewFolderName")

MoveFile

Move a file (file_name, path_from, path_to)

OP.MoveFile ("filename.txt"),("C:\Users\Patrick\Documents\"), ("C:\Users\Patrick\Desktop\")

Contact