Results 1 to 7 of 7
  1. #1
    GinaFlanagan is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2018
    Posts
    4

    Lightbulb Login Form pass data to another Form


    I am looking for an example where a Login Form 1 has a combobox for the "username" and Form 2 is populated "ONLY" with the value "username" that was selected in Form 1. The combo box in Form 2 re-queries another combo box. I am surprised I haven't seen a similar login form already. I found a transfer data zip, but in Form B you still see all of the choices in the drop down, not "Only" what was selected in Form A.
    I forced this to happen in my Form except my tables do not have "ID's" eventually I need to add this to the database. Also,I need to add a text box for a password, and example would be helpful. All of this has made me crazy I have spent all weekend on trying to figure this out.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    User login is a common topic. Have you searched this forum?

    Why did you provide 2 db's?

    In FinalListBoxIndexTransfer Nothing in code changes combobox RowSource so of course it will show a complete list. All code does is set Value of combobox on each form.

    In ScorecardsPopulateForm, do you want to open Scorecord filtered to department selected on Login?

    DoCmd.OpenForm "Scorecard", acNormal, , "Contact='" & Nz(Me.ComboDepartment, 0) & "'"

    However, Scorecord form is UNBOUND and its subform has a reference error.
    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.

  3. #3
    GinaFlanagan is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2018
    Posts
    4
    Look again number 3. actually filters (Me.combogoals.Requery)number 4. So the employee/contact only sees their goals. Previously the combo was bound but all employees/contacts were available. So I thought the reasoning behind the login in form was so they would only see their data. Maybe I am overthinking.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    Reasoning behind login form is to validate and identify user. Then code uses login info to apply filter to other form(s) or otherwise restrict user interactions.

    Whether you allow them to select user from combobox or type into a textbox is your choice.

    Correction: controls on form Scorecard are not bound so no records are displayed.

    Your original code is not applying filter anyway.

    Don't know what you mean by "number 3" and "number 4".
    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.

  5. #5
    GinaFlanagan is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2018
    Posts
    4
    Quote Originally Posted by June7 View Post
    Reasoning behind login form is to validate and identify user. Then code uses login info to apply filter to other form(s) or otherwise restrict user interactions.

    Whether you allow them to select user from combobox or type into a textbox is your choice.

    Correction: controls on form Scorecard are not bound so no records are displayed.

    Your original code is not applying filter anyway.

    Don't know what you mean by "number 3" and "number 4".
    Then code uses login info to apply filter to other form(s) (This is what I need help with, the code that uses login info to apply a filter) My users have several goals. (The controls were bound, I deleted the table on purpose that was bound because all employees were available to select from the dropdown) I only want the user who is "logged in" to see their goals from the dropdown (I do not want them to have the ability to select another user's name and to see the other user's goals) I will post the code tomorrow but number 3. (on the form I have it numbered) ComboDepartment determines the goals that are displayed for number 4. dropdown (ComboGoals) If you select the dropdown for number 4. the records are displayed only for the contact listed in number 3. I will do a video tomorrow. I am very close to having this solved. Users have many goals, One-to-Many (This database is shared on our network)

  6. #6
    GinaFlanagan is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Jul 2018
    Posts
    4
    My coworker said I should bound combo again to the table and put a select statement in my code with a where statement for the rowsource based on a login form.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    Maybe. But I really don't understand what you are trying to accomplish with combobox.
    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: 1
    Last Post: 06-03-2016, 08:23 PM
  2. Pass Data From Form To Report
    By Juan4412 in forum Forms
    Replies: 9
    Last Post: 02-07-2016, 09:13 PM
  3. Replies: 1
    Last Post: 11-14-2015, 12:09 PM
  4. Pass data from one form to another
    By Bruce in forum Forms
    Replies: 16
    Last Post: 02-25-2013, 03:59 PM
  5. Replies: 1
    Last Post: 08-02-2010, 01:19 PM

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