hi stev
ya, it is working. now i have add & edit button as well as save
now when i clickon save, i have the following code. there are n
compile ar run time error still the the data does not get added o
saved(after editing ) in the table(tbl_user). i am stuck since las
three days in this this. please help
Private Sub Cmd_Save_Click(
On Error GoTo ErrorHandle
'Validation for the null values in password and confirm passwor
field
If IsNull(txtPassword.Value) Or IsNull(txtCnPwd.Value) The
MsgBox "Please enter password and then confirm password
txtPassword.SetFocu
Exit Su
End I
'Comparing the password
Dim lsStr As Strin
lsStr = StrComp(txtCnPwd, txtPassword
If lsStr = 0 The
'Save the record after "Edit
If flag = "Edit" The
' Set m_cn = New ADODB.Connectio
' Set m_rs = New ADODB.Recordse
' Set m_cn = CurrentProject.Connectio
' m_rs.Open "tbl_user", m_cn, adOpenKeyset, adLockOptimisti
' CboUserName.SetFocu
' m_rs.Fields(1) = CboUserName.Valu
' txtPassword.SetFocu
' m_rs.Fields(2) = txtPassword.Tex
'm_rs.Clos
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord,
acMenuVer7
MsgBox "UserName successfully added
txtCnPwd.SetFocu
txtCnPwd.Text = "
txtPassword.SetFocu
txtPassword.Text = "
CboUserName.SetFocu
Dim ll_var As Lon
ll_var = Form_tbl_user.CboUserName.ListInde
ll_var =
'Save the record after "Add
End I
If flag = "Add" The
If IsNull(txtUserName) The
MsgBox "Please enter the User Name
txtUserName.SetFocu
Exit Su
End I
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord,
acMenuVer7
MsgBox "UserName successfully added
txtCnPwd.SetFocu
txtCnPwd.Text = "
txtPassword.SetFocu
txtPassword.Text = "
txtUserName.SetFocu
txtUserName.Text = "
Exit Su
End I
Els
MsgBox "The passwords do not match. Please enter again
'Clear the password and confirm password field
txtCnPwd.SetFocu
txtCnPwd.Text = "
txtPassword.SetFocu
txtPassword.Text = "
End I
Exit Su
ErrorHandler
MsgBox "Following error occurred i
Form_tbl_user:Cmd_Save_Click(): " & Err.DESCRIPTIO
End Su
Steve Schapelwrote Ravi
Using the first suggested method would probably allow the passwor to be
edited
Otherwise, you could take the expression out of the Control Sourc of
the PasswordTextbox (whatever it's called), and use the AfterUpdat
event of the combobox to run code like this..
Me.PasswordTexbox = Me.NameOfCombobox.Column(1
--
Steve Schapel, Microsoft Access MV
ravishankar wrote
hi steve
thanks for that. it worked fine. but the problem is i want to edi th
password that is fetched from the table. i am using the secon metho
specified by you. but the system says " you cant modify th passwor
as it is bound to =[NameOfCombobox].[Column](1
please throw some light on this
rav
[/quote:25d7c293b8