Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

Next VendorID

Posted on by 1,035

I am trying to create a customization to discover the next VendorID in a sequence

 

Here is my code so far

 

' Begin Customization Screen: 0327000  Version: 6 Sequence: 500  UserId: "KEN FILLMORE" Description: "A New Customization" System Administrator: FALSE Secure: 55 Begin SAFTools.SAFButton btnNext '' Created         =   True '' Version         =   6    caption         =   "Next Nbr"    height          =   25    left            =   302 '' parent          =   "Form1" '' parentform      =   "Form1"    tabindex        =   908    top             =   38    visible         =   TRUE    width           =   76 End

' Begin Macro Text

Source: 1 ' VBComponent: ThisScreen, ComponentType: 100 ********************************************************** Private Sub btnNext_Click() Dim SqlStr$

SqlStr = "UK%" SqlStr = "select max(VendId) from Vendor where Vendid like" + SParm(SqlStr)

Call sql(c1, SqlStr)

serr1 = SGroupFetch1(c1, bVendMax.VendId, LenB(bVendMax.VendId))

Call SetStatusBarText("Last UK Vendor is " + bVendMax.VendId, "")

End Sub

 

' VBComponent: VendorDH, ComponentType: 1 ********************************************************** Attribute VB_Name = "VendorDH" Option Explicit   Type VendMax     VendId                          As String * 15 End Type   Global bVendMax As VendMax, nVendMax As VendMax ' End VBComponent **********************************************************

 

' Reference: Name=VBA, Guid={000204EF-0000-0000-C000-000000000046}, Major=4, Minor=2 ' Reference: Name=SWIMAPI, Guid={F4B33A61-96B4-11CF-B04B-0020AFDCBD63}, Major=1, Minor=1 ' Reference: Name=stdole, Guid={00020430-0000-0000-C000-000000000046}, Major=2, Minor=0 ' Reference: Name=SWIMAPIEx, Guid={C97F43B1-4A73-11D3-BF6C-006008C7915A}, Major=1, Minor=1 ' Reference: Name=SolVBWrappedControlsLib, Guid={A88846F2-6638-11D3-8154-00104B2E8513}, Major=1, Minor=0 ' Reference: Name=SAF, Guid={DA357F2F-39C1-11D1-88AA-00609731B697}, Major=6, Minor=8

' End Macro Text

' End Customization

 

The application appears to fall over when SGroupFetch1 is executed

This code is almost identical to the example given

 

Can someone tell me where I have gone wrong?

*This post is locked for comments

  • Verified answer
    KenF58 Profile Picture
    KenF58 1,035 on at
    RE: Next VendorID

    This has now been resolved. I did not realise the need for a Form Load to do the Set Address bit

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans