ACC2000: How to Add New Record to a Combo Box with Double-ClickID: Q209836
|
This article describes how to set up a macro so that you can add new values to a combo box. The article uses the Orders form in the sample database Northwind.mdb as an example.
Follow these steps to modify the Orders form so that you can add new values
to the Salesperson combo box:
CAUTION: Following the steps in this example will modify the sample
database Northwind.mdb. You may want to back up the Northwind.mdb file
and perform these steps on a copy of the database.
Macro Name Condition Action
-----------------------------------------------------
NewRecord OpenForm
OnClose [EmployeeID] Is Not Null RunCommand
... SelectObject
... ReQuery
... SetValue
NewRecord Actions
---------------------------------------------------------
OpenForm
Form Name: Employees
View: Form
Data Mode: Add
Window Mode: Normal
OnClose Actions
----------------------------------------------
RunCommand
Command: SaveRecord
SelectObject
Object Type: Form
Object Name: Orders
In Database Window: No
ReQuery
ControlName: EmployeeId
SetValue
Item: [Forms]![Orders]![EmployeeID]
Expression: [Forms]![Employees]![EmployeeID]
OnDblClick: Macro1.NewRecord
StatusBarText: Double-click to Add a New Employee
On Close: Macro1.OnClose
Additional query words: doubleclick update record
Keywords : kbdta McrHowto
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: May 13, 1999