Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write a form macro and set its default start position

Macro

How to write a form macro and set its default start position

by  rvspy  Posted    (Edited  )
ACCPAC 5.0 and above must be installed.

1. Create a VBA macro in ACCPAC by using the macro editor
2. Insert a form into your macro
3. Right-click on Toolbox within the VBA Editor
4. Select to add the UI control you want to customize e.g. ACCPACPO1210UICtrl
5. Drag and drop to place the UI control on the form.
6. Select Tools->References from menu.
7. Find ACCPAC Data Source Control 1.0 and check it.
8. Add the following code to your control:
' Declare a data source control for use
Option Explicit
Dim WithEvents dsPO As ACCPACPO1210.ACCPACDSControl
Private Sub AccpacPO1210UICtrl1_OnUIAppOpened()
' set your data souce control to one of the UI data source controls
Set dsPO = AccpacPO1210UICtrl1.UIDSControls(10)
' Define where you want your UI to start by default
dsPO.Fields("PONUMBER") = "PO000000028"
End Sub

Note
----
The above logic can be applied to just about any data entry forms in ACCPAC 5.0 and up. To find out details of each form, use the UI Info tool.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top