Hi All,
Aoplogies in advance for the long winded post below but i wanted to tell you the full story!
I'm trying to automate some data entry to the analytical accounting (AA)analysis from the sale transaction entry window.
I have set some VBA code to run when the (AA) screen is opened as normal from the Sales Transaction Entry window (the AA screen is launched from the extras menu or by Crtl T). AS the AA aplication is a separate dictionary and I need to get the value of a field on the sales transaction window I have to have a reference to GP from the AA project.
The code works fine,but I now want to automate the screen opening and populating from the print and /or save button of the sales transction entry window, so that the user does not have to remember to luanch the window. This is where I am getting the problem.
First I couldn't reference back the AA project as this would be a cyclic reference which is not allowed. So i tried to use the sendkeys option (I know this is not ideal but it would get the job done here).
The sendkeys did not work, it just seems to be ignored by VBA.
I then tried to get around the cyclic reference by declaring a variable at the module level for the data i needed from the sales transaction window and then linking AA and GP by referecing both through advanced security. This enabled me to reference AA from GP and to run a window open command for the AA window.
the problem with this that the business logic from the sales transaction window is not being run so the AA window just opens with nothing in it.
So having rambled on, my questions are these.
1. Is there anything that can stop sendkeys from functioning?
2. If sendkeys isn't the way then is there a way of opening this screen so that the business logic does run.(or to put it another way can I access the normal launch mechansim for the screen by using VBA).
I hope one of you can give some help with this one, it is tantalisingly close and so all the more frustraing!!
thanks
Boat
Aoplogies in advance for the long winded post below but i wanted to tell you the full story!
I'm trying to automate some data entry to the analytical accounting (AA)analysis from the sale transaction entry window.
I have set some VBA code to run when the (AA) screen is opened as normal from the Sales Transaction Entry window (the AA screen is launched from the extras menu or by Crtl T). AS the AA aplication is a separate dictionary and I need to get the value of a field on the sales transaction window I have to have a reference to GP from the AA project.
The code works fine,but I now want to automate the screen opening and populating from the print and /or save button of the sales transction entry window, so that the user does not have to remember to luanch the window. This is where I am getting the problem.
First I couldn't reference back the AA project as this would be a cyclic reference which is not allowed. So i tried to use the sendkeys option (I know this is not ideal but it would get the job done here).
The sendkeys did not work, it just seems to be ignored by VBA.
I then tried to get around the cyclic reference by declaring a variable at the module level for the data i needed from the sales transaction window and then linking AA and GP by referecing both through advanced security. This enabled me to reference AA from GP and to run a window open command for the AA window.
the problem with this that the business logic from the sales transaction window is not being run so the AA window just opens with nothing in it.
So having rambled on, my questions are these.
1. Is there anything that can stop sendkeys from functioning?
2. If sendkeys isn't the way then is there a way of opening this screen so that the business logic does run.(or to put it another way can I access the normal launch mechansim for the screen by using VBA).
I hope one of you can give some help with this one, it is tantalisingly close and so all the more frustraing!!
thanks
Boat