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

[RESOLVED] How to increment value in vb6

$
0
0
I'm having a problem increment the value of Text25.I was trying to increment the value when each time the data is saved.

Below is what i have done

Private Sub Command1_Click()
On Error Resume Next
Dim X As Integer
X = 0
X = X + 1
If Text1.Text <> "" And Text2.Text <> "" And Text3.Text <> "" And Text5.Text <> "" And Text6.Text <> "" And Text7.Text <> "" Then
With frmchief.Adodc4
.Recordset.AddNew
.Recordset!ID = Text1.Text
.Recordset!Date_Time = Text2.Text
.Recordset!Nurse_Diagnosis = Text3.Text
.Recordset!Recommendation = Text5.Text
.Recordset!Medicine = Text6.Text
.Recordset!Qty = Text7.Text

.Recordset.Update
.Refresh
.Refresh
End With

MsgBox "Saved!", vbInformation
End If

frmstatus.Command1.Enabled = False
frmstatus.Text26.Text = Text1
frmstatus.Text29.Text = Text6
frmstatus.Text30.Text = Text7


frmstatus.Text25.Text = X
Unload Me
frmstatus.Show

Viewing all articles
Browse latest Browse all 21238

Trending Articles



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