473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Saving Password

13
im a beginner in programming, and im currently working on my first project which is the book borrowing system.
my only problem is that everytime i try to change the password of my system.. when i hit the cancel button the previous password disappears and u i can easily enter in the system without inputting password.where do u think is the problem?
thanks.



Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdCancel_Click()
  2. If MsgBox("are you sure you want to cancel?", vbQuestion + vbYesNo, "Cancel") = vbYes Then
  3. Data1.Recordset.CancelUpdate
  4.     normalButton
  5.     Call txtinactive
  6.  
  7.     cmdEdit.Enabled = True
  8.     cmdSave.Enabled = False
  9.     cmdCancel.Enabled = False
  10. Else
  11.     End If
  12. End Sub
  13.  
  14. Private Sub cmdEdit_Click()
  15. If txtuname = "Administrator" Then
  16. MsgBox "Only Password can edit", vbInformation, "Borrower's List System"
  17.     txtuname.Visible = False
  18. End If
  19. Data1.Recordset.Edit
  20.  
  21. lblnew.Visible = True
  22. lblpass.Visible = False
  23. lbluser.Visible = False
  24. txtuname.Visible = False
  25. lblAdmin.Visible = True
  26.  
  27.  
  28. Call add_record
  29. txtpass = ""
  30. txtretype = ""
  31. txthint = ""
  32. End Sub
  33.  
  34. Sub add_record()
  35. txtuname.Enabled = False
  36. txtpass.Enabled = True
  37. txtretype.Enabled = True
  38.  
  39. cmdSave.Enabled = True
  40. cmdCancel.Enabled = True
  41. End Sub
  42. Private Sub txtinactive()
  43. txtpass.Enabled = False
  44. txtretype.Enabled = False
  45. End Sub
  46. Private Sub normalButton()
  47. cmdEdit.Enabled = True
  48. cmdSave.Enabled = False
  49. cmdCancel.Enabled = False
  50. End Sub
  51. Private Sub cmdMain_Click()
  52. Unload Me
  53. frmMenu.Show
  54. End Sub
  55.  
  56. Private Sub cmdSave_Click()
  57. If txtretype = "" Or txtpass = "" Or txthint = "" Then
  58. MsgBox "Incomplete Information!", vbError + vbOKOnly, "Admin account"
  59. ElseIf txtretype = "" Then
  60. MsgBox "re-type password first", vbInformation + vbOKOnly, "Admin account"
  61. ElseIf txtpass = txthint Then
  62. MsgBox "You password and passwordhint must not be the same", vbInformation + vbOKOnly, "Password"
  63. txthint = ""
  64. ElseIf txtpass = txtretype Then
  65.     If MsgBox("Are you sure you want to save changes?", vbQuestion + vbYesNo, "Save Changes") = vbYes Then
  66.  
  67.         Data1.Recordset.Edit
  68.         Data1.Recordset.Fields("Confirm").value = txtretype.Text
  69.         Data1.Recordset.Fields("Password").value = txtpass.Text
  70.         Data1.Recordset.Fields("Hint").value = txthint.Text
  71.         Data1.Recordset.Update
  72.  
  73.         MsgBox "Account has been Successfully Updated.Program will restart to update your new password.", vbDefaultButton3 + vbMsgBoxSetForeground, " Account"
  74.         cmdEdit.Enabled = True
  75.         frmLogin.Show
  76.         Unload Me
  77.  
  78.  
  79.         Call normalButton
  80.         Call txtinactive
  81.  
  82.         cmdEdit.Enabled = True
  83.         cmdSave.Enabled = False
  84.         cmdCancel.Enabled = False
  85.     End If
  86. Else
  87. MsgBox "password not match", vbInformation + vbOKOnly, "admin account"
  88. End If
  89. End Sub
  90.  
  91. Private Sub Form_Load()
  92. lblAdmin.Visible = False
  93. lblnew.Visible = False
  94.  
  95. Data1.Visible = False
  96.  
  97. End Sub
  98.  
Attached Images
File Type: jpg Screenshot.jpg (51.1 KB, 140 views)
Oct 21 '14 #1
4 1239
twinnyfo
3,653 Expert Mod 2GB
Proggy,

It is difficult to follow your code to determine exactly what you are trying to do in it.

First, you give us no indicate what Data1 is or where it comes from. You also use a very unorthodox way of updating your data. It is not "wrong", just unorthodox and not very typical.

It does not appear that your form is simply built around a table with bound controls, but it is not clear from either your code or from your picture.

If anything, when changing passwords, you should verify all the information concerning the passwords before you save it to your table. That way if anyone cancels the action, there have not been any changes made.

Not sure if this helps much, but if you can describe in a little better detail how you want your project to work, we'll be glad to take a look into it.
Oct 21 '14 #2
Proggy
13
this problem particularly refers to managing accounts of the administrator.but since this project can only be used by admin only password can be changed.
do u want to look on my project?
Oct 22 '14 #3
Proggy
13
HI this is the project i made.
im not really a good programmer.
and im trying to improve my knowledge.
i hope u understand.
:)
Attached Files
File Type: zip LatestWork.zip (2.42 MB, 52 views)
Oct 22 '14 #4
twinnyfo
3,653 Expert Mod 2GB
Proggy,

We typically don't have Posters send in their projects, as usually threads deal with specific questions regarding one particular aspect of the project, rather than the project itself.

However, regarding your particular question, please let us know how your form is related to your table(s). At this point, we don't even know what your table(s) look like, and the structure will dictate how to solve your problem.

We are willing to assist, but we need more information.

If you want, you can take a look at this article (How To Create User Permissions and Customized Menus in MS Access), which appears to be more involved than what you may want at this point, but would also point you in the right direction for user permissions.

Let us know how we can further assist.
Oct 22 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Doug Bell | last post by:
Hi I am having difficulty getting a password form to work correctly. I am using VB.Net. The required functionality is to allow a change to a setting but when a save button is clicked a password...
1
by: Gidrazas | last post by:
Hello I'm trying to generate DataSet from Sybase ASA 9 database. I'll use it in Crystal Reports. But when i'm trying to drag table from Server Explorer as written in...
10
by: Karl Burrows | last post by:
Here's a simple script I have pulled from various sources and wondered if there was a way to improve it. First, if the type the wrong password, I would like to redirect them to another login page...
36
by: dcrespo | last post by:
Hi all, I have a program that serves client programs. The server has a login password, which has to be used by each client for logging in. So, when the client connects, it sends a string with a...
0
by: Per Schjetne | last post by:
I set the "allow saving password" on the connection in the VS IDE/Data connections. But after closing and reopening, the password and the "allow saving password" checkbox is lost. I have this...
5
by: Neil G Jarman | last post by:
Hi, I would like to save my user's passwords as an encrypted sting. Are their built in functions for doing this? It's not financial data or anything, just to keep away prying eyes. many...
2
by: chiefsitebuilder | last post by:
I have a question about saving an MS Access program to CD and verifyng that the program works after being saved. Here is my situation, I have a person who developed an application for me using...
5
by: Lucvdv | last post by:
This would better be described by 'serialization' than 'interop', but I didn't find a newsgroup that seems closer on topic. The problem in a few words: I save data with DataSet.WriteXML, but I...
1
by: Punkis | last post by:
Hello all. I am having some questions about a subject. I am running a small social community using SocialEngine and i want to include phpbb3 with an arcade mod or any arcade board that support high...
7
by: Jesse Jones | last post by:
Any ideas on how to send info from one form into another domain or how to write a default value for a new user's password with a formula? Here's what I'm trying to do: design my database so that...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.