Results 1 to 2 of 2

Thread: compare form fields

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    1

    compare form fields

    This is easy, but I can't figure it out....a couple things. First, I have a connection with one of my databases that I am using to allow my users to change their password. I want to be able to have them confirm their password just to be sure they typed it in correctly. I have seen different ways of doing this but I just want a simple comparison. Secondly, I have it set up where they have to enter their old password, just to be sure. If the old password doesn't match the one in the database, it won't update. I want it to prompt them that they have made an error, and instead of going to the confirmation page, prompt them what their error was.

    Thanks in advance

  2. #2
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    you could provide one text box first, and use an IF statement and if if matches, make visible, on the same form, a second text box and test those for equality.


    VB Code:
    1. 'This would be in a button_click event
    2.  
    3. frmDialog.showdialog
    4.  
    5. 'this would be in another _click event on frmDialog
    6.  
    7. dim OldPass as string = textbox1.text
    8.  
    9. if pass <> [whats on the DB] then
    10.  
    11. 'provide an error here
    12.  
    13. else
    14.  
    15. textbox2.visible = true
    16. buttonChangePass.visible = true
    17. end if
    18.  
    19.  
    20. 'This would be a _click event for a buttonChangePass
    21.  
    22. if textbox1.text <> textbox2.text
    23.  
    24. 'provide an error here
    25.  
    26. else
    27.  
    28. 'Make the changes on the database according to text box1 or 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width