Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

VBA question for Sales Transaction Entry

(0) ShareShare
ReportReport
Posted on by

Hello!  I need some help troubleshooting a VBA customization that we use for pricing on the Sales Transaction Entry screen.  GP Pricing doesn't work for us so we have a VBA form that allows a user to select a price, and that price is applied to the line item in VBA with UnitPrice.Focus (price).  This works great we have no problems.

Sometimes the users need to review and/or change pricing after the order was already entered.  So I added a button to the header on Sales Transaction Entry that will open the same VBA window and allow the user to select the price, using the same UnitPrice.Focus command.  This works great until an item is on backorder.  In this case it causes GP to crash with a ntdll error, which corrupts the Sales Order the user was working on.  This is absolutely driving us crazy!

Is there another VBA command that should be used to set pricing on the current line in the SalesTransactionEntryDetail form from the SalesTransactionEntry form?

Here is my code:

SalesTransactionEntry:

Private Sub ItemPricing_Changed()

Dim ssellprice As String
        ssellprice = SalesTransactionEntryDetail.DisplaySalesQuote(Trim(CustomerID.Value), Trim(SalesTransactionEntryDetail.ItemNumber.Value))

End Sub

SalesTransactionEntryDetail:

Public Function DisplaySalesQuote(ByVal CustomerID As String, ByVal ItemNumber As String) As String
    Dim ssellprice As String
    Load frmPriceQuote 'Custom VBA Form to Allow User to Select Price
    frmPriceQuote.lblCustomerID.Tag = CustomerID
    frmPriceQuote.lblItemNumber.Tag = ItemNumber
    frmPriceQuote.Show 1
    ssellprice = frmPriceQuote.gsSellPrice
    If ssellprice <> "" Then
       UnitPrice.Focus CSng(ssellprice)

    End If
End Function

Thanks in advance for any ideas you might have!  I have completely run out of them.

John

*This post is locked for comments

  • RE: VBA question for Sales Transaction Entry

    Thanks for the suggestion but that didn't have any effect. 

    Out of desperation I changed the variable name in the Sales Transaction Entry form and couldn't reproduce the issue anymore (SalesTransactionEntry and SalesTransactionEntryDetail both used a variable with the same name).  No idea why that would cause an issue but I'm going to roll that change out to the users and see if they still get the ntdll crash.

  • Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: VBA question for Sales Transaction Entry

    CSng() is specific to Microsoft Excel, try using CDbl(ssellprice) instead or Format(ssellprice, "Standard"). Let me know if that works.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans