Send Email in Access VBA using CDO SendObject OlMailItem

This tutorial explains how to send email in Access VBA using CDO, SendObject and olMailItem Send Email in Access VBA using CDO, SendObject, OlMailItem There are mainly two methods of sending email in Access VBA. The first method is to use CDO Object, another is to use SendObject Method, I will explain each method in the below sections. Send Email in Access VBA using SendObject Method To send email using SendObject Method is simple, because it does not require SMTP sever address and port numb...
Read More

Send Email in Access VBA using SendObject Method

This tutorial explains how to send Email in Access VBA using SendObject Method Send Email in Access VBA using SendObject Method To send email using SendObject Method is simple, because it does not require SMTP sever address and port number. When you run SendObject, whoever run the code will trigger to send email from its Outlook, instead of sending from a specific server email. It is a little bit strange because if you develop an application that sends confirmation email to user who have just ...
Read More

Access Continuous Form Conditional Formatting enable issue

This tutorial explains how to apply Conditional Formatting in Access Continuous Form and issue with enable. Access Continuous Form Conditional Formatting Continuous Form is a Form that shows multiple records in a Single Form. In contract, Single Form shows one record in each page. In VBA, you may change the color of Text Box using If condition, but it only works in Single Form. For Continuous Form, the criteria only checks the first record and apply the format to the rest of all records. To so...
Read More

MPF Ordinance in Hong Kong

MPF Ordinance in Hong Kong This tutorial explains the core concepts of MPF Ordinance in Hong Kong. All data were updated as at 2015 March, I may not be able to constantly update the Ordinance. MPF Enrollment Permitted Period is the period within which an employer must enroll employees in an MPF scheme. Employment type Permitted Period Non casual employee the first 60 days of employment Casual employee the first 10 days of employment Self employed person the first 60 ...
Read More

Access DoCmd.OpenForm Method to open Access Form

This tutorial explains how to use Access DoCmd.OpenForm Method to open Access Form in Access VBA Access DoCmd.OpenForm Method - open Access Form DoCmd.OpenForm Method is used to open Access Form. Syntax of Access DoCmd.OpenForm Method- open Access Form DoCmd.OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs) FormName Name of Form (in String) View Optional. How you want to view the Form Name Value Description acDesign 1 The for...
Read More

Return Access Form input to Access Report or Form or Query

This tutorial explains how to return Access Form input to Access Query, Access Report, Access Form MS Access Search Form In order to explains how to return Access Form input to Access Query, Access Report, Access Form, , I will illustrate with a room booking system example. To goal of the below example is to allow employee search which room he has booked in the system. Step 1 - Create a room booking database In this database, I created four fields, each employee can book multiple ro...
Read More

Access VBA DoCmd.RunSQL Method and Error 2342

This tutorial explains how to use Access VBA DoCmd.RunSQL Method command and cause of Error 2342 (due to using non-action query such as Select statement) Access VBA DoCmd.RunSQL Method and Error 2342 DoCmd.RunSQL Method runs specified SQL statement. The SQL statement can only be action query (such as create table, modifying data), but not Select statement. Syntax of DoCmd.RunSQL Method DoCmd.RunSQL(SQLStatement, UseTransaction) SQLStatement A string expression that's a valid SQL st...
Read More

Access Round Function and custom Round Function

This tutorial explains how to use Access Round Function (round to even logic) and create a custom Round Function to simulate Excel Round Function. Access Round Function - Round to even logic Access Round Function is completely different from Excel Round Function. For Excel Round Function, if decimal part is >=0.5, the integer rounds up, otherwise the integer rounds down. For Access Round Function, as well as Access VBA, Excel VBA, the Round Function uses "Round to even" logic. Integ...
Read More

Vertical line in Access Report using Line Method

This tutorial explains how to add vertical line in Access Report using VBA Line function, while the line tool fails to draw a continuous vertical line. Issue with using Line tool to add vertical line in Access Report Vertical line in Access Report is one of the hottest topic in this website. In Access Report, it is possible draw a vertical straight line using "Line" tool under  "Design". However, the line is not continuous across  records. Lets take a look at what I mean the line is n...
Read More

Run Excel Macro from Access VBA

This Access tutorial explains how to run Excel Macro from Access VBA, either write Excel Macro directly in Excel or you can write Excel Macro in Access. You may also want to read: Run Access Macro using RunCode Run Excel Macro from Access VBA One of the uses to run Excel Macro from Access is when you use VBA to export tons of Access reports to Excel. By default, exporting Access report as Excel gives you no formatting but plain text. However, it would be convenient if you can export th...
Read More