Skip to content

Commit e880424

Browse files
committed
Create application-load-from-text.md
1 parent 66be375 commit e880424

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

application-load-from-text.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Application.LoadFromText
3+
TOCTitle: Application.LoadFromText
4+
ms:assetid: 6cd9963e-7edc-4834-b4c2-0983fe47e72b
5+
ms.date: 08/06/2024
6+
ms.localizationpriority: medium
7+
---
8+
9+
# Application.LoadFromText
10+
11+
**Applies to**: Access 2024, Access 2019
12+
13+
The Application.LoadFromText is a method used to import database objects (like forms, reports, queries, etc.) from a text file into an Access database. This is often paired with [Application.SaveAsText](application-save-as-text.md), which exports database objects to text files. These methods are particularly useful for version control, backups, or transferring objects between databases.
14+
15+
## Syntax
16+
17+
Application.LoadFromText _ObjectType_, _ObjectName_, _FileName_
18+
19+
## Parameters
20+
21+
|Parameter|Description|
22+
|:--------|:-----------|
23+
|_ObjectType_|The type of object (e.g., acForm, acReport, acQuery, etc.).|
24+
|_ObjectName_|The name of the object to be imported.|
25+
|_FileName_|The full path to the text file containing the object definition.|
26+
27+
## Example
28+
29+
Here’s how you can import a form that was saved as a text file.
30+
31+
```vba
32+
Application.LoadFromText acForm, "MyForm", "C:\Backup\MyForm.txt"
33+
```
34+
35+
## Remarks
36+
37+
Be cautious when using LoadFromText with complex queries involving subqueries, as it may occasionally result in corrupted queries. This method is unsupported but widely used by developers for advanced tasks like version control or automated deployments.

0 commit comments

Comments
 (0)