Results 1 to 2 of 2
  1. #1
    apinshot is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    1

    Retrieve & Validate Data on 2nd Form based on Record Selected on 1st Form

    Can I look up and verify data on a “second” form based on a selected record from first (still open) form.



    I’m trying to allow users to select a User Name from a combo box list and then open a “Change Password” form when they select “Change Password” for that selected user name.

    My problem is that I can’t figure out how to associate and verify the data tied to the user name selected on the previous (Login) form –( I’m trying to validate the old password tied to that selected record).

    I have the first login form created, and it’s working just fine. I also have the change password form created (and it’s displaying the user name selected from the first form – using:

    Code:
    Private Sub Form_Load()
     With Forms![frmLogin]![cboUserName]
       Me.txtPwdChgUserID = .Column(2, .ListIndex)
     End With
    End Sub
    I also have the code written to validate and confirm old password, new password and validate new password (when the save button is clicked). I have yet to update the password with the new password (still trying to figure that out).

    Form screenshots:
    Click image for larger version. 

Name:	ChngPwd_Issue.JPG 
Views:	8 
Size:	51.6 KB 
ID:	13225

    Any help would be appreciated. I can send more details if needed. Thank You!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    Bind second form to Users table and open filtered to single record. The Load code is not needed. Bind textbox to the user name field. If name parts are in separate fields (as they should be) then concatenate them with expression in ControlSource.

    DoCmd.OpenForm "Change Password", , , "UserID=" & Me.comboboxname

    Then code can reference fields from record to validate entry in the Old Password field and to record the new password into the record. Set the New and Confirm boxes as not visible or not enabled until the Old password is verified then turn them on.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 02-27-2012, 02:05 PM
  2. Replies: 9
    Last Post: 10-12-2011, 02:34 PM
  3. Validate Form Field based on Duplicate Data
    By bornfattom23 in forum Forms
    Replies: 3
    Last Post: 11-05-2010, 02:02 PM
  4. Replies: 1
    Last Post: 10-13-2010, 12:40 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums