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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Script to require fields in Vendor Maintenance

Status
Not open for further replies.

IBPIT

IS-IT--Management
Feb 21, 2002
32
US
I created the following script, but am having a few issues with it. I am hoping someone can help me resolve:

If trim(ML_NAME) = "" Then

msgbox "Please fill out Vendor Name before Accepting"

Elseif trim(ML_Add1) = "" Then

msgbox "Please fill out Vendor Address before Accepting"

Else

Set WshShell = CreateObject("WScript.Shell")
sh.AppActivate("* Vendor Maintenance")
WshShell.sendkeys "%h"
set WshShell = nothing

End if

I have created a new "&Accept" button on the Vendor Maintenance screen and renamed the original button as "Finis&h".

I am running MAS200 v3.71.

If I run the following three lines from the script, it works without errors (this section basically activates the original button that I have renamed):

Set WshShell = CreateObject("WScript.Shell")
WshShell.sendkeys "%h"
set WshShell = nothing

When I add the "IF" statement(s) in the script, it will not recognize text entered in the vendor name field.

I am also having issues with the line " sh.AppActivate("* Vendor Maintenance")". The script errors out if I include this line in the script.

Any help would be greatly appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top