Results 1 to 14 of 14
  1. #1
    b_best is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    19

    Frmlogon to open table for that user only

    Hello, I have been having and issue with this for a week now. I am making a task/job database. I have a user pick there name from a drop down andd there password and then it will go to eather a user or admin page. All is working but when the subpage opens it askes for the ID (number). Here is the code for the login. (everything is working here) Just dont know if I am missing something. I have attached a test version of my database

    So here is a list:


    frmlogon (pick name) (password) + This works
    Goes to one of two pages + This works
    Name comes up on page + This works
    Shows you, your data only - This does not (it askes for the ID)

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    There was an issue with the forms that open after you logon. If you open either of those forms directly you get the same prompt for the ID. I could not track from where the actual error was originating so I just created a new form.

    I do not see the reason for having two separate forms, but rather just open 1 form filtered to the person who just logged in. If there are controls that the user will not have access to based on their credentials you could either hide or lock those controls as the form opens.

    I also fixed the login attempt part of your code. I also just hid the logon form after login rather than close it. If the form is hidden you can always reference data on that form for use later on.

    I also got rid of the module you had. If you leave the logon form open but hidden you have access to the info for the currently logged on user.

    In addition, I got rid of the Dlookup's you had. You can bring in the password field via the combo box and reference it's column in the code to check the typed in password against.

    Now, the bigger issue--your tables.

    First it is recommended to not have spaces or special characters in your table or field names. You use spaces, /, - etc. in several of your field names. The underscore _ is OK

    I also got rid of the full name field in the contact table. That was redundant since you can use an expression to concatenate the first and last names. See the query qryContacts (which is used to populate the combo box on the logon form).

    The task table will need a lot more work. I see three date fields that each refer to various events (due, completed, implemented). If you have multiple events related to a task then that describes a one-to-many relationship which warrants that the events (and their associated dates) be in a separate but related table.

    For the other fields, you will have to explain the purpose of each and what type of data they are designed to hold. With that we should be able to get your table structure set up properly.

  3. #3
    b_best is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    19
    Thank you jzwp11,

    With your help I can what I did not do correctly. Your have given me hope that I can finish this. Oh and thank you about reminding me about the names. I was just not thinking of that. Thank you again.
    Brian

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You're welcome. If I can be of help sorting out the task table, please let me know.

  5. #5
    Nefarias is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    1
    The id parameter message is coming from the report. If you look at contact_details for example you have a subreport on the report. If you select the subreport and look at the link master fields property it is set to "ID". The problem is that the main report (contact_details) query "tasks" doesn't have a field in it named "ID" so that is why it is prompting you for the field. If you open up the tasks query in design view you will notice your primary key column is named "unique task id". You need to rename this field to ID and then make sure it is an actual column in the query and the message will go away. You might want to check your other reports and make sure those sub report joins are correct as I only looked at the one. Hope that makes sense.

  6. #6
    b_best is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    19
    Thank you again for all your help on this. I have one more question. When the user logs in and see's there work I would like them to enter a new task. How can I make a form that will remember who it is that is logged in?

  7. #7
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    If you do not close the logon form (just hide it like I did in the code), you can reference the selection from the combo box anywhere else so you will always know who logged in.

  8. #8
    b_best is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    19
    Thank you that is usefull. One more thing if you dont mind.
    Login form (goes to)
    Contact_details (link to a macro to open new form "named details" to enter new data)
    is the Macro right to open a new form? Can I keep the login name on this form?

    Sorry for all the questions.

  9. #9
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Does the macro open a second form that contains the user information or just opens a form to enter info about somebody new? If somebody new, that is not an issue.

  10. #10
    b_best is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    19
    I would like it to open a second form I created. I am tring to to make it so that if "AAA" logs in It then shows him his task list. He would like to add a new task. So he clicks "new task" this opens up a new second form, (his name) is automaticly in the name field. This is so he does not add tasks to others.
    I hope this helps.

  11. #11
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    In the example I provided, the form opens to that person's tasks (in the subform). Why can't they just enter a new task in the subform--it will automatically be tied to them since the main form is filtered to them already. Why open yet another form?

  12. #12
    b_best is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    19
    Why? I have some people who are not very computer savy. I thought If I gave them a button to open a small form for them to fill out there weekly tasks it would be helpfull.

  13. #13
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You can pass the ID of the logged in person to the form that opens by setting a control on that form to the same value as the combo box in the loggin form

    forms!newlyopenedformname!controlname= forms!logonformname!comboname

    You may have an issue if the new form that opens is not a form/subform design. It should work fine for the first record that is added, but if you try to add second new task record the ID value may not persist without some additional code. (this is from memory, you would have to test this out). I generally do not work with macros so I could not tell you how you to set up that.

  14. #14
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Another option is place the button you mention but open an unbound form and use code to append the new record and then close the form. If the user wants to add a second task they would click on the button a second time.

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

Similar Threads

  1. Replies: 3
    Last Post: 01-05-2012, 09:57 AM
  2. Add a User to a table
    By label027 in forum Forms
    Replies: 1
    Last Post: 10-20-2011, 01:08 PM
  3. create user interface from table
    By mer in forum Forms
    Replies: 5
    Last Post: 07-24-2011, 08:07 PM
  4. Unable to open db if not the first user
    By shabbott in forum Security
    Replies: 3
    Last Post: 02-25-2011, 08:24 PM
  5. Multiple end user have DB open
    By Desstro in forum Programming
    Replies: 5
    Last Post: 11-27-2010, 10:13 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