Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

License key/Tax key

$
0
0
Pliz help me,I have developed a payroll package in Visual basic.The challenge i have is developing a key generator or License key whatever you may call it.so that if i input the clients name,the number of employees for the client and the tax year it should be able to give me the annual license number or compay reference number and a tax key for that year with 18number digits each.License key is permanent while tax key is tempral because tax budget change every year. i tried this code

Private Sub cmdgenerate_Click()
MyString = Trim(Me.CoName.Text)
Ct = 1
MyCoRefNo = 0
MyCoRefNo2 = 0
For Ct = 1 To 50
If Mid(MyString, Ct, 1) <> "" And Mid(MyString, Ct, 1) <> " " Then
MyCoRefNo = MyCoRefNo + Asc(Mid(MyString, Ct, 1))
End If
Next Ct
Me.CoRefNo2 = (MyCoRefNo * CInt(14 / 9))
If Mid(Me.CoRefNo, 5, 2) = "09" Or Mid(Me.CoRefNo, 5, 2) = "18" Or _
Mid(Me.CoRefNo, 5, 2) = "27" Or Mid(Me.CoRefNo, 5, 2) = "36" Or _
Mid(Me.CoRefNo, 5, 2) = "45" Or Mid(Me.CoRefNo, 5, 2) = "54" Or _
Mid(Me.CoRefNo, 5, 2) = "63" Or Mid(Me.CoRefNo, 5, 2) = "72" Or _
Mid(Me.CoRefNo, 5, 2) = "81" Or Mid(Me.CoRefNo, 5, 2) = "90" Or _
Mid(Me.CoRefNo, 5, 2) = "82" Then
Me.CoRefNo2 = Me.CoRefNo2 & Mid(Me.CoRefNo, 5, 2)
If Me.CoRefNo2 < 100000 Then
Me.CoRefNo2 = Me.CoRefNo2 + 100000
Me.CoRefNo.Text = MyRs!CoRefNo

If MyRs!TaxMthNo = 1 Or MyRs!TaxMthNo = 2 Or MyRs!TaxMthNo = 3 Or _
MyRs!TaxMthNo = 4 Or MyRs!TaxMthNo = 5 Or MyRs!TaxMthNo = 6 Or _
MyRs!TaxMthNo = 7 Or MyRs!TaxMthNo = 8 Or MyRs!TaxMthNo = 9 Then
MyString = MyRs!CurrentYr & "/" & MyRs!CurrentYr + 1
Else
If MyRs!TaxMthNo = 10 Or MyRs!TaxMthNo = 11 Or MyRs!TaxMthNo = 12 Then
MyString = MyRs!CurrentYr - 1 & "/" & MyRs!CurrentYr
End If
End If

Me.CoRefNo2.Text = 0
MyString = Trim(MyString)
Ct = 1
For Ct = 1 To 9
If Mid(MyString, Ct, 1) <> "" And Mid(MyString, Ct, 1) <> " " Then
Me.CoRefNo2.Text = Me.CoRefNo2.Text + Asc(Mid(MyString, Ct, 1))
End If
Next Ct

Me.CoRefNo2.Text = Me.CoRefNo.Text + (Me.CoRefNo2.Text * CInt(15 / 7))
i
End If
End If
End Sub

Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>