Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2006
    Posts
    108

    Unanswered: on login open form

    the database i am making is for a golf club where i work, i was making it to keep track of the scores for the members there.

    here is the problem i have run into. is there a way i can set it so that when someone logs in it opens their specific form ex: john dalton logs in and it opens form john_g_dalton and then he exits and when bob barker logs on it opens the form bob_fucken_barker?

    i was just wondering if thats possible.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Yep. It is possible ... And there are a few ways to do it ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Do I see a bad Adam Sandler reference snuck in the original post ....

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I wouldn't think you'd want to have a separate form for each member. You'd want one form that filtered data to the member who logged in. Look at the wherecondition argument of OpenForm.
    Paul

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Open forms depending on login

    I agree that it would be a bad idea having several forms pertinent to each user but if you're intent on doing it this way you could try something like the following (in general):

    1. Use the get loginID routine previously posted to find out the user LoginID (I have a few posts on this.)
    2. Have a table (i.e. FormToOpenTable) with 2 fields - LoginID, FormToOpenFld fields.
    3. Once the user LoginID is gotten (again see the posts on getting the user's loginID), call another function which opens the FormToOpenTable using a select statement such as "Select FormToOpenFld from FormToOpenTable where LoginID = '" & LoginID & "'".
    4. Store the FormToOpenFld in a variable and then docmd.openform " & VariableName & "

    Others will probably have some different solutions - this was what I could come up with quickly (I hope you get the general idea as I didn't write out all the code). The point being that you have a table which stores the user's LoginID and the Form to open. You could also use the dlookup command instead of the select statement as this probably won't be a very big table to search through (i.e. FormToOpenName = Dlookup("[FormToOpenFld]","[FormToOpenTable]","[LoginID] = '" & LoginID & "'").
    Then Docmd.openform " & FormToOpenName & "
    I think the docmd.openform " & FormToOpenName & " would probably work although I haven't actually tried it.

    I think it would probably be better though to open a central form and then set fields visible/invisible or whatever parameters you need to do based upon the LoginID (unless each form is very different in design per user).
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Jul 2006
    Posts
    108
    well i was trying to keep it simple for me you do also understand that i will have upwards of 100+ tables (1 table for every member) to keep track of their scores

  7. #7
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    That's simple? You should have 1 table with a field for a member identifier. One form based on that table, easily filtered to only show 1 member's data.
    Paul

  8. #8
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    i will have upwards of 100+ tables (1 table for every member)
    woah!!!!!

    How about 2 tables: 1 for members and 1 for scores.

    tblMembers
    MemberID (Autonumber)
    MemberName (Text)

    tblScores
    ScorID (AutoNumber)
    MemberID (Integer)
    TheScore
    TheDate (Date/Time, default = Now() )
    ... and what ever else you need to know about each particular game, such as course, weather conditions, etc.

    One query to add the names to the scores and one form to update/review the scores by member

    tc

  9. #9
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I was thinking about member data and forgot about the scores, which would have to be in a separate table. tcace has the right idea. You could display this with a form (member)/subform (scores). Master/child links would keep the scores displayed those of the currently displayed member.
    Paul

  10. #10
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    100 Tables

    100 Tables??? Wow!!! Try to find similar fields that exist in each table and bring them together in more centralized tables separating them by adding "grouping" type of fields. 100 Tables is an extreme amount of tables for the application you've specified and I would find it difficult to believe that you wouldn't have the same field names or similar information in the fields in the different tables.

    I always try to think of it as a "grouping" method where you have 1 table with fields which hold the same information for each "golfer" separated by additional field(s) which groups the information (if that makes any sense). In other words, instead of having 1 table for each golfer, have 1 table which has the same fields you have for each of the 100 tables and add fields which might distinguish or group the golfers.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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