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

Another VBA Toolbar User Date question 1

Status
Not open for further replies.

35mph

Vendor
Aug 22, 2004
152
US
I'm clear on using 7.5 to get the toolbar objects for 8.0 (thanks, David), but when I use the toolbar to get the Great Plains User Date, it's called ZoomButton and doesn't seem to work.

A. Is that the field I should be using, and my syntax is simply wrong?
B. I tried using the 8.0 UserDate.AccSysDate field, but that User Date windows is not open when I'm setting the date (in the PO entry screen)... so how can I get THAT date without opening the UserDate window? Is there a way to "open" it without maiking it visible?
C. Using RetrieveGlobals.dll doesn't include the date.

How can I get to the User Date in 8.0 Purchase Order entry screen?

THANKS!
 
Well, here's what I did... surely there's a more elegant way?

Private Sub Save_AfterUserChanged()
If Me.PONumber = "" Then
Dim OrigDate As Date
UserDate.Open
OrigDate = UserDate.AccSysDate
UserDate.Close
Me.OldDate.Locked = False
Me.OldDate = OrigDate
Me.OldDate.Locked = True
End If
End Sub
 
Man... it just doesn't end... now, using that solution above, that has the effect of adding a (blank) record, so when I'm ready to close the PO window, I'm asked if I want to save it or delete it...
 
Please cut and paste the following into a notepad file called "Toolbar.package". This will give you access to the date field on the toolbar without having to open the userdate window. I used Dex to move the Zoom Button out of the way so I could add the date field to VBA. I have also renamed the field as Date is a VBA reserved word.


<Component Name="Toolbar" ProductId="0" Object="VBAForm" >
VBAForm "Toolbar"
{
Windows
{
Window "Main_Menu_1"
{
Code "Option Explicit
"
EventMode "0"
Fields
{
WindowField "(L) eEnterpriseUser ID"
{
ArrayIndex "0"
DisplayName "eEnterpriseUserID"
Local "true"
ProgrammerName "eEnterpriseUser ID"
}
WindowField "Company Name"
{
ArrayIndex "0"
DisplayName "CompanyName"
Local "false"
ProgrammerName "Company Name"
}
WindowField "Date"
{
ArrayIndex "0"
DisplayName "UserDate"
Local "false"
ProgrammerName "Date"
}
WindowField "Zoom Button"
{
ArrayIndex "0"
DisplayName "ZoomButton"
Local "false"
ProgrammerName "Zoom Button"
}
}
Title "Toolbar"
}
}
}
</Component>



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.
 
Use the Toolbar package above and use code similar to this below from the PO Entry form.

Sub PONumber_Changed()
If PONumber.Empty then
DocDate = Toolbar.UserDate
Me.Changed = False
End If
End Sub

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, once again, you are the man.

I got around the last problem I had by using a BeforeModal Dialog section...

I'm braindead right now, so I'll try this a little later, but THANK YOU for your help with this. It looks like just what I need.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top