VBA to Login Specific User (1 Viewer)

waseem0888

Member
Local time
Today, 01:23
Joined
Jul 25, 2020
Messages
51
Hello,

I need help I am not much familiar with Access I am trying to learn. I have created one DB from my idea I know it will not be more efficient but I need help from you guys. I have to store some records from one form but there is one column in my table is called Type and it's having different types of records like ITP, SOR NCR, etc... but it has to save at once with all their related fields by a single button which i was not getting how to store it can be done through combo box by selecting my type but it will store only that type and its records but what i want it to save all types and record at once but how to save in single column all type from the combo. So what i did I just made different tables for all types and then saving all records from one form but i need that type and it other fields in a sequence in one table so for that, I combine all tables in the query and there is a query named qryProject. So if is there any other solution to this problem you can suggest.

Second, i made the user login and there is one combo which user will select the project and after login, it has to access only that project to enter update or to see the charts. so for that, i write code and on my data entry from and the Project combo box rowsource i have set the criteria to get the project which is working fine because project data is directly from the project details table.
1633343899283.png
But i facing an issue on my other form to get the particular project only there in the rowsource data is from the query so when i put criteria to get the project its not showing project results and same on charts form also. and i need one more thing if the user is from one project it should not login access to other projects don't know how to code this. and i want one more option if the user is from HQ which is not related to any project so he should have access to all project data he should get all projects in combobox. i am attaching my DB for more clarity user name is admin and the password is admin123. kindly check what are possibilities to get my requirements done

Thankyou
 

Attachments

  • QC Summary Dashboard..accdb
    2.9 MB · Views: 341
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:23
Joined
Feb 19, 2002
Messages
43,213
If you want to restrict the user to the one project he chose on the login form, leave the login form optn but set its visible property to No. THEN, all your queries need to reference the project combo on the hidden login form to flter the results.

I didn't look in depth at your app but it looks like you have made a lot of work for yourself by the method you chose. Do the calculations for each type in a totals query and bind each totals query to a separate subform. The form will load quicker because it won't have to do all those domain functions to separately collect each piece of data.

Using abbreviations as you have pretty much makes the app unintelligale to anyone who doesn't know what the acronoms mean/ It also looked like that you should use fewer tables since some of the "types" have the same data layout. To put them in the same table, just add a type column. That reduces the forms/queries you need. You just add criteria to the query so that it brings up typeA or typeB.
 

Users who are viewing this thread

Top Bottom