mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
28 lines
813 B
TypeScript
28 lines
813 B
TypeScript
/// <reference types="windows-script-host" />
|
|
|
|
let app = new ActiveXObject('Access.Application');
|
|
app.UserControl = true;
|
|
|
|
// opens a form
|
|
app.DoCmd.OpenForm('MyForm', Access.AcFormView.acNormal, '', 'LastName="Smith"');
|
|
|
|
// change the contents of a textbox
|
|
// tslint:disable-next-line:no-unnecessary-type-assertion
|
|
let textbox = app.Forms('MyForm').Controls('MyTextBox') as Access.TextBox;
|
|
textbox.Text = 'Not Smith';
|
|
|
|
// save the current record on the active form
|
|
app.RunCommand(Access.AcCommand.acCmdSaveRecord);
|
|
|
|
// close the form
|
|
app.DoCmd.Close(Access.AcObjectType.acForm, 'MyForm');
|
|
|
|
// open a report for printing
|
|
app.DoCmd.OpenReport('MyReport');
|
|
|
|
// open the same report in Design View
|
|
app.DoCmd.OpenReport('MyReport', Access.AcView.acViewDesign);
|
|
|
|
// run a VBA macro
|
|
app.Run('MyMacro', 'argument1', 2);
|