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