×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

I have a custom screen with PO OCX

I have a custom screen with PO OCX

I have a custom screen with PO OCX

(OP)
I have a custom screen with PO OCX on a .NET form. I replaced the Post button with my own new Post button. I wanted to validate only the Items of the vendor can be posted. I could get to the point where the Post did not get fired even when the Items are valid. Below is my code. At the end of the code where I commented "//This event never fires" is the issue. I want "vPostButton.Value = true" to run the Post of the PO. Can you help please. Appreciate your input.

private void btnNewPost_Click(object sender, EventArgs e)
{
//vPostButton = acPO.UIAppControls["APP_Post_Button"];
//vPostButton.Value = false;

bool bOkay = true;
List<string> lstMsg = new List<string>();
string sVendor = dsPOHeader.Fields.FieldByName["VDCODE"].get_Value().ToString();

dsPODetail.GoTop();
dsPODetail.Read();

if (dsPODetail.Exists == true)
{
if (dsPODetail.Fetch())
{
do
{
string sItem = dsPODetail.Fields.FieldByName["ITEMNO"].get_Value().ToString();
string sUnitCost = dsPODetail.Fields.FieldByName["UNITCOST"].get_Value().ToString();

if (Is_Item_In_VendorItems(sItem, sVendor) == false)
{
string sMsg = "Item : " + sItem;
lstMsg.Add(sMsg);
bOkay = false;
}
} while (dsPODetail.Fetch());
}
}

if (bOkay == false)
{
string sMsg = "";
for (int i = 0; i < lstMsg.Count; i++)
{
sMsg = sMsg + lstMsg[i] + "\n";
}
MessageBox.Show("Can't Post. The below PO line items are not for Vendor " + sVendor + "\n\n" + sMsg);

// vPostButton = Accpac acPO.UIAppControls["APP_Post_Button"].GetControl();
vPostButton.Value = false; //This event never fires
}
else
{
//vPostButton = acPO.UIAppControls["APP_Post_Button"];
vPostButton.Value = true; //This event never fires
}
}

RE: I have a custom screen with PO OCX

I can't read your code - use code tags.

Did you do anything to the original button like disable it or make it not visible? I had a problem similar to this (might have been the PO form - don't remember) but I had to set the original button's .left value to a negative number and NOT set macrovisible to false because the underlying code wouldn't work. I also likely set the tabstop of the button to false OR I set up code so if the user tabbed into the original button that I set focus on my replacement button.

RE: I have a custom screen with PO OCX

I need bit more details, from your side

I can suggest to use using vb control extenders (it's vb6-sdk coding)
and

capture "On record changing" event to customize for your requirement..


Thanks
Ram

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close