Private Sub btn_addc_Click()
On Error Resume Next
If Me.txtAddc.Text = "" Then
MsgBox "Please fill up", vbInformation, "ADD CATEGORY"
Exit Sub
End If
If Me.btn_addc.Caption = "ADD" Then
If rs.State = adStateOpen Then rs.Close
rs.Open " Select * From tbl_category WHERE CategoryList ", db, adOpenStatic, adLockOptimistic
If rs.RecordCount > 0 Then
MsgBox "The Category you have entered is already Existed", vbCritical, "Error"
btn_refresh_Click
Me.txtAddc.Text = ""
Me.txtAddc.SetFocus
Else
With rs
.AddNew
.Fields("CategoryList") = Me.cmb_addc.Text
.Update
End With
MsgBox " Category Successfully Added.", vbInformation, "CATEGORY"
btn_refresh_Click
End If
End If
End Sub
Kemuel 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
rproffitt commented: Armenian is better on this. Շատ վատ. Shat vat! +14
AssertNull 1,094 Practically a Posting Shark
rproffitt commented: A thesis based on something from 1998. Must be an archaeology student. +14
ddanbe 2,724 Professional Procrastinator Featured Poster
rproffitt 2,662 "Nothing to see here." Moderator
AssertNull 1,094 Practically a Posting Shark
ddanbe 2,724 Professional Procrastinator Featured Poster
AssertNull 1,094 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.