|
Private Sub cmdsubmit_Click() Dim s As String RS.Close RS.Open "select * from users", CN s = RS(1) RS.AddNew
Do While (txtname.Text <> "" And txtuid.Text <> "" And txtpwd.Text <> "" And txtconfirmpwd.Text <> "") If (txtname.Text = "" Or txtuid.Text = "") Or (txtpwd.Text = "" Or txtconfirmpwd.Text = "") Then txtname.SetFocus End If RS(0) = txtname.Text If s = txtuid.Text Then MsgBox "User Id already exists", vbCritical + vbInformation, "User Exists" txtuid.SetFocus If s <> txtuid.Text Then RS(1) = txtuid.Text RS(2) = txtpwd.Text ElseIf RS(2) = txtconfirmpwd.Text Then RS(3) = txtconfirmpwd.Text Else MsgBox "Confirm Password must be same ", vbCritical + vbInformation, "Wrong Password" txtconfirmpwd.SetFocus End If RS.Update MsgBox "User Id and Password Created " Loop MsgBox "Enter Data", vbInformation txtname.SetFocus
this way i have given the code
|