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

VBA ON NOTES WINDOW 1

Status
Not open for further replies.

bawa63

Vendor
Jun 7, 2004
83
US
I wanted to put some VBA code on the notes window for inventory control. I included the window in VBA and the relevant fields, and added code, but this code runs even when notes window is opened from say customer cards. What variables define whether this window is opened from inventory cards. Please help.
 
Why don't you set a flag (VBA public variable) when the note button is pressed from your window.

Then the VBA code can check if the flag is set and clear it for next time. That way you know who opened the note window.

Be aware that there are actually 5 note windows and so you will need to duplicate your code onto all five of them.

To open all five, you will need to open notes from 5 different locations.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
David, Please be more specific. What VBA public variables can I set? Does VBA start running as soon as someone logs into GP or is it activated only when a window with VBA is opened. I tried putting "GLOBAL" variables in the VBA code but it gives errors. What's the best way to do this and also what's a good reference for VBA for GP? Thanks.
 
If you declare your VBA variables in the module for your inventory control form as public variables at the top of the module (not inside any procedures) they will be public and can be addressed from other modules (forms).

The best reference is the VBA programmers guide PDF which is installed with Great Plains. It discuss the Great Plains specific functionality. For the pure VBA, any reference book is valid.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
David, thanks for the help, i will try them out and holler back if i have any problems.
 
Dave, i declared a public variable on top of the itemMaintenance (window) module and set it here when the notes button is pressed. When i reference this variable from note(window) module, it is empty. How and where do I set a public variable so it can be available in all modules? Please help.
 
Declaring the variable will not set it to any value, you will need to set it to a value.

If you were able to reference it from the Note window you have declared it correctly.

Did you use ItemMaintenance.Variable to reference it?

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
David, yes that was the error i was making. After I referenced it the way you said, it worked like a charm. Thanks a ton.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top