Hi,
My requirement is ,In customer maintenance screen i want to add a button ,if i press the button then ,In customer Id field will display the maximum custid+1.
Example in customer table max id is 23 then result will be "000000024"
it's very urgent please can any one help me?...
My code is
Private Sub Button1_Click()
Dim Sqlstmt As String
Dim lsNexCustid As String
Dim liNexCustid As Long
Sqlstmt = "Select Top 1 * from customer order by custid desc"
err_Customer = sqlfetch_Customer1(Sqlstmt)
If err_Customer = NOTFOUND Then
NextCustid = "000000001"
Else
liNexCustid = CLng(bxCustomer.CustId) '"000000001" '
liNexCustid = liNexCustid + 1
lsNexCustid = Format(liNexCustid, "000000000")
End If
Call SetBufferValue("bcustomer.custid", lsNexCustid)
Call DispFields("form1", "ccustid")
Call Edit_Save
End Sub
Public csr_Customer As Integer
Public err_Customer As Integer
In here i got sqlfetch_Customer =0 only...
Function sqlfetch_Customer(Sqlstmt As String) As Integer
sqlfetch_Customer = SqlFetch1(csr_Customer, Sqlstmt, bCustomer, LenB(bCustomer))
End Function
i am also adding Customer Dh files.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148