Others

How to Include an Access Form Field Value in an Email with VBA

Muhammad TalhaMuhammad Talha Nov 10, 2026 869 views

Question details

The user needs to successfully pass a specific form field value into an email body generated via VBA in Microsoft Access.

How to Include an Access Form Field Value in an Email with VBA
Product
Microsoft Access
Device & OS
not provided
Scenario
Automating email generation from an Access form using a VBA macro.
Observed behavior
The VBA script executes and sends the email successfully, but the value entered in the SRNumber form field is missing from the email body.
Before you start

Verify the exact name of your form control in the Property Sheet, as VBA references rely on the control's 'Name' property rather than its displayed label text.

Solution 1Recommended

Use Explicit Form Control References in VBA

Correctly reference the form control's name based on your code's location to ensure its value is retrieved and appended to your email string.

When a VBA-generated email successfully sends but lacks the intended form data, the issue usually stems from an incorrect reference to the form control's name or its execution scope.

1
Identify the exact control name

Open your Access form in Design View, click on the text box (e.g., the SRNumber field), and check the 'Name' field in the Property Sheet. Do not confuse it with the label name (like 'SR#').

2
Update VBA code with a full reference

If your VBA code is stored in a standard module outside the form, reference the control explicitly by adding the form name: body = "Service request: " & Forms!YourFormName!SRNumber.

3
Use the 'Me' shorthand in form modules

If your VBA code is located directly inside the form's own module (such as a button click event), simplify the reference by using: body = "Service request: " & Me.SRNumber.

Use Explicit Form Control References in VBA
Data Type Check: Ensure the control is a text box or a compatible data type that can be easily concatenated into a string variable without causing a type mismatch error.
Free Microsoft Office alternative

Looking for a Lightweight, Reliable Office Suite? Try WPS Office

While Microsoft Access is a specialized database tool, most daily office tasks revolve around documents, spreadsheets, and presentations. If you are dealing with complex Microsoft Office issues, consider switching to WPS Office for a lightweight, free, and fully compatible alternative for all your core office needs.

  1. 1. Visit the WPS Office Website: Navigate to the official WPS Office site to access the free download.
  2. 2. Download the Installer: Click the 'Download WPS Office Free' button to get the lightweight installation file.
  3. 3. Install and Set Up: Run the installer and follow the straightforward prompts to seamlessly set up your new office suite.
Highly compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formats.Robust spreadsheet capabilities with extensive formula and VBA/macro support for automation.Lightweight installation with a familiar, tabbed user interface.Completely free to download and use for your essential daily tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why is my Access VBA email sending blank values for my form fields?

This typically happens if the VBA code references the control's attached label text instead of the actual control name, or if the form is closed before the VBA code finishes executing. Ensure you use the exact 'Name' property found in the Property Sheet.

What is the difference between 'Me.ControlName' and 'Forms!FormName!ControlName' in Access VBA?

The 'Me' keyword is a shortcut used to refer to the current form where the VBA code is running. 'Forms!FormName!ControlName' is a full, explicit reference that must be used if the VBA code is executing from a standard module or a different form entirely.

How do I add multiple form field values to my email body in VBA?

You can concatenate multiple field values using the ampersand (&) operator. For example: body = "Name: " & Me.FirstName & " Request: " & Me.SRNumber.