Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

VBA Freight Tax

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

We have an issue on when to assess tax on freight. We have 2 types of customers, our corp owned and franchisees. All customers are in every US states. We just want to assess freight tax on our franchisees. Currently the setting is nontaxable on freight.

My solution is to create a VBA on the sales order entry window. Once lose focus on the freight field, the VBA will update the non-taxable to based on customer freight taxable option if it's a franchisee.  I'm stuck on the technical names of the fields, so can anyone help with the object names for the sales tax detail window and the freight taxable drop down list? Or if there's a written code that i could use, that would be awesome!

Thanks in advance

Hung

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: VBA Freight Tax

    I think i'm close. I created a macro to run when the freight field lose focus. The macros opens the sales tax schedule window, change the freight taxable from "non-taxable" to "'based on customer", click ok, then click recalculates when asked "this change will affect the current tax calculation".

    It works but the one hiccup is when the user makes a change on the freight again. I get this error message, "No modal dialog appeared. (Line #8)" . Any ideas on how to bypass this error message?

    Here's my code, be gentle I'm not a programmer.

    Private Sub Freight_AfterUserChanged()

    If (CInt(CustomerID) > 2000 And CInt(CustomerID) < 9999) Then

    'run frt taxable macro

    SendKeys "+{F1}"

     Else

     End If

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans