hello there! i am developing a registration form of users data...but i got a problem...what i want to happen is that if an id,name, username,password already exists msgbox will appear that it is already existing...here is my initial code..can u add it for what i want to happen with my form? i am using the adodb...
Private Sub cmdreg_Click()
If txtname.Text = "" Or cboposition.Text = "" Or txtusername.Text = "" Or txtpasswrd.Text = "" Then
MsgBox "Fill up the blank fields", vbInformation, "Info"
Else
If rs.State = adStateOpen Then rs.Close
rs.Open "Select * from users", cn, adOpenKeyset, adLockPessimistic
With rs
.AddNew
rs!id = txtid.Text
rs!Name = txtname.Text
rs!Position = cboposition.Text
rs!UserName = txtusername.Text
rs!Password = txtpasswrd.Text
rs!Date = Date
rs.Update
MsgBox "Registered", vbOKOnly
End With
txtname.Text = ""
cboposition.Text = ""
txtusername.Text = ""
txtpasswrd.Text = ""
txtpasswrd.Text = ""
txtrpasswrd.Text = ""
txtname.SetFocus
' MsgBox "password did not match", vbOKOnly (here i have a repeat password textbox..what i want also to happen is that if it mismatch..msgbox will appear that password mismatch..)
'txtrpasswrd.Text = ""
' txtrpasswrd.SetFocus
End If
End Sub
please add my code....