How to disable toolbar button and load another item on item maintenance form

SOLVED

I have a customization project to create a customized item copy function on Inventory Item Maintenance form. A custom command button is added to the form. When user clicks the button, it fires stored procedure I created to copy the current item with a new ItemID.

The form has a built-in copy command button on toolbar, is it possible to disable this built-in command button on toolbar

After the copying is done, how to reload the form with new item id

Thanks

Parents Reply
  • 0 in reply to dbcoles
    SUGGESTED

    I tested your code and it worked. 

    Form.Controls("tbrMain").ButtonEnabled("K11") = FALSE

    By the way, I figured out how to load a item with a new item

    'issue cancel command
    oForm.HAndleToolbarClick CStr("K7")

    'populate lookup control with new itemid
    Form.Controls("lkuMain").Text = stringNewItemID

    'Issue a refresh command to load the new itemID
    oForm.HAndleToolbarClick CStr("K25")

    Thank you for your help. I marked the question answered.

Children
No Data