![status bar access vba status bar access vba](https://www.engram9.info/access-vba-programming-2/images/3630_47_34.jpg)
If there is no current supplier on the Suppliers form, display a message. Message: Move to the supplier record whose products you want to see, then click the Review Products button again. This macro should be attached to the Review Products button on the Suppliers form. It also shows the use of a conditional expression with the MsgBox, GoToControl, and StopMacro actions. It shows the use of the Echo, MsgBox, GoToControl, StopMacro, OpenForm, and MoveSize actions. The following macro opens the Product List form in the lower-right corner of the Suppliers form, displaying the current supplier's products. Set the Supplier ID control to the current supplier on the Suppliers form. Stop screen updating while the macro is running. This macro should be attached to the Add Products button on the Suppliers form. The GoToControl action then moves the focus to the Category ID field, where you can begin to enter data for the new product. The SetValue action sets the Supplier ID control on the Products form to the current supplier on the Suppliers form.
![status bar access vba status bar access vba](https://www.sourcecodester.com/sites/default/files/styles/large/public/images/donk90/pb_sb_0.jpg)
It shows the use of the Echo, Close, OpenForm, SetValue, and GoToControl actions. The following macro opens the Add Products form from a button on the Suppliers form. Examples Set the value of a control by using a macro To run the Echo action in a Visual Basic for Applications (VBA) module, use the Echo method of the DoCmd object. If you turn echo off, you can use the Hourglass action to change the mouse pointer into an hourglass icon (or whatever mouse pointer icon you've set for "Busy") to provide a visual indication that the macro is running. This allows you to change the status bar text while the macro runs. You can run the Echo action more than once in a macro. To suppress all message or dialog boxes except error message boxes and dialog boxes that require the user to enter information, use the SetWarnings action. You can use dialog boxes and pop-up forms to gather or display information, even if echo is turned off. The Echo action doesn't suppress the display of modal dialog boxes, such as error messages, or pop-up forms, such as property sheets. The No setting for the Echo On argument doesn't affect the functionality of the macro or its results. When the macro finishes, Access automatically turns echo back on and repaints the window. When you set the Echo On argument to No, the macro runs without updating the screen. When Access runs a macro, screen updating often shows information not essential to the functioning of the macro. For example, when echo is turned off, the status bar can display "The macro is running." The text to display in the status bar when echo is turned off. The Echo macro action has the following arguments.Ĭlick Yes (turn echo on) or No (turn echo off) in the Echo On box in the Action Arguments section of the Macro Builder window. Note: The Echo macro action isn't available in Access web apps.