General :: Login To See Own Records But Admin To See All Records

Dec 16, 2013

I have a user login code am using for users to login and only access their records in a subform according to their user ID and access level (user or admin). On the main form I have a user name field, the password field and two other fields: one to hold userID and the other to hold access level.

I also want if the person logged in has "Admin" access level the subform should return records from all users. For now what is happening is that even when I assign myself with "Admin" access level, the subform is not returning all records from other users, but my own records only. The original demo where I found the code worked well but I cannot find it and I am totally lost on this.

Here is the code I have so far:

Code:
Private Sub cmdLogin_Click()
Me.Hold_User_ID = Nz(DLookup("User_ID", "T_Users", "Username='" & Me.UserName & "' and pword='" & Me.PWD & "'"), -1)
' check to see if we have a good login
If Me.Hold_User_ID = -1 Then
MsgBox "Invalid username or password."

[code]...

View Replies


ADVERTISEMENT

Modules & VBA :: Separate Users And Admin On Login

Jul 8, 2014

I need to separate Users and admin on login so that the admin can go to admin form and users to specific form using vba access. Here is my login code

Private Sub cmdLogin_Click()
'Check to see if data is entered into the password box
If IsNull(Me.cboUserName) Or Me.cboUserName = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.cboUserName.SetFocus

[Code] .....

View 8 Replies View Related

General :: Admin Has No Permissions At All

Jul 16, 2013

Now there is only one set of permissions Admin, and Admin has no permissions at all. When I try to check admin rights or even read rights back to the Admin it says I need to be logged in as admin, which I am.

Is there anyway at all I can either copy some information from 2 tables and put it in my back up?? I'm really stuck here and need to fix this or I'll have lost considerable amounts of work.

View 5 Replies View Related

General :: Set Password For Tables And Forms - Allow Admin View Only

Apr 21, 2013

I have a receptionist which uses a database that contains everything in the company ..there is an employee table that contains their salaries and I want to set password for this table so that the admin is the only person who can view this table .......... is that possible?? And the same thing for a form that controls this table!

View 4 Replies View Related

General :: Lock File Shows Admin User Active For All Clients

Jul 2, 2013

We have a split ACC2010 database, with the back end on our server and 5 front ends on 5 client PCs. I hadn't run a compact/repair on the back end for months. When today I tried, I got the 'database is locked' error. The lock file showed 'Admin' logged on at all 5 clients. The front-ends had been closed on all 5 clients. We do not have a user called 'Admin'. Because my issue occurs for all clients, it might be caused by some sort of programming error in the front end.A VBA bug (implicit comparison to a control in an If .. Then construct) caused this type of behaviour but was resolved in Access 2007.

View 12 Replies View Related

General :: Filter All Records That Contain Same ID Value

Jun 23, 2014

In access, I have the following: 2 sub forms located in an overall form. I would like when I select a record in the first subform, that the second subform would automatically filter for all records that contain the same ID Value.

View 1 Replies View Related

General :: Update While Going Through Records

Jan 22, 2013

I am working on a DB for work. Currently the form has 3 options, each one selected hides/shows different fields pertaining to that option. Works great when you are putting data into the tables using the form. Problem is when you start that the beginning and click 'next'. When clicking next you do not see the fields show or hide. How do I make this happen?

View 3 Replies View Related

General :: How To Get Unique Records

Oct 24, 2012

I am trying to build a query using two tables. One is a table called sanctuary lakes cleaning data. The other one is called Faulire data. In cleaining table there are four years of cleaning records for each pit. I want to find the performance of these cleaned pits using failure table. Each failure date should have only one correspoding cleaning date. I wrote the following query. This query works. But it gives duplicate data. Some of the records will show two cleaning dates for a failure.

My query is like this.

SELECT DISTINCTROW [Sanctuary Lakes cleaning data].PIT, [Sanctuary Lakes cleaning data].[Cleaned Year], [Sanctuary Lakes cleaning data].[Cleaning Date], [Sanctuary Lakes cleaning data].[SR NO], [Failure data table].[Failure Year], Min([Failure data table].Failure_date) AS MinOfFailure_date, [Failure data table].[Failure SR no]
FROM [Failure data table] LEFT JOIN [Sanctuary Lakes cleaning data] ON [Failure data table].Pit = [Sanctuary Lakes cleaning data].PIT
GROUP BY [Sanctuary Lakes cleaning data].PIT, [Sanctuary Lakes cleaning data].[Cleaned Year], [Sanctuary Lakes cleaning data].[Cleaning Date], [Sanctuary Lakes cleaning data].[SR NO], [Failure data table].[Failure Year], [Failure data table].[Failure SR no]
HAVING (((Min([Failure data table].Failure_date))>Min([Sanctuary Lakes cleaning data]![Cleaning Date])))
ORDER BY [Sanctuary Lakes cleaning data].PIT;

My results are as follows:
PIT Cleaned Year Cleaning Date SR NO Failure Year Failure_date Failure SR no
1-08 2007/08 16-Oct-07 213458 2011/12 13-Aug-11 414984
1-08 2007/08 16-Oct-07 213458 2011/12 25-Jun-12 478589
1-08 2009/10 19-May-10 313497 2011/12 13-Aug-11 414984
1-08 2009/10 19-May-10 313497 2011/12 25-Jun-12 478589
1-08 2010/11 22-Feb-11 379081 2011/12 13-Aug-11 414984
1-08 2010/11 22-Feb-11 379081 2011/12 25-Jun-12 478589
1-08 2011/12 17-Apr-12 458430 2011/12 25-Jun-12 478589

I want the following results.

PIT Cleaned Year Cleaning Date SR NO Failure Year Failure_date Failure SR no
1-08 2010/11 22-Feb-11 379081 2011/12 13-Aug-11 414984
1-08 2011/12 17-Apr-12 458430 2011/12 25-Jun-12 478589

How can I modify my query?

View 2 Replies View Related

General :: Subform Does Not Accept More New Records

May 14, 2013

I have a db for my clinic with 3 tables, one is Patient (P_ID, P_Name, P_Age, P_Sex...etc. The second is Referral (R_ID, R_Date, R_Clinic, R_Diagnosis...etc. The third is Therapist (T_ID, T_Name, T_Division, TherapyDate, T_Plan...etc.

The main form contains all patient info and below I have a subform showing info from both other tables (Referral and Therapist).

Each patient could have more than one referral, so I made the relation between Patient table and Referral table, one to many.

Other relations are as follow:

Patient to Therapist (one to many) because one patient could be treated by different therapist each time he is referred.

Therapist to Referral (one to many) because one therapist could handle many referrals.

Now for the first patient, I entered the first patient info in the main form and then the referral and therapist info in the subform, then the same patient was referred to me for the second time, when I attempted to enter the second record (referral) in the subform I am not able to. Why I do not Know, I am sure I did something wrong.

By the way most of the fields in the subform are comboboxes except for dates.

View 4 Replies View Related

General :: Group Records By Month

Aug 3, 2012

I would just like to know if it is possible to group Months together: this is what i have did so far :

Code:
SELECT Count(Source.ID) AS CountOfID, Clusters.Cluster_Desc, Department.Dept_Desc, DatePart('m',Source.Day_Month_Year) AS [Month], Source.Original_Source, Source.Headline, Source.Issue, Source.Analysis, Source.Action
FROM Source INNER JOIN (Department INNER JOIN (Clusters INNER JOIN Cluster_Dept ON Clusters.Cluster_ID = Cluster_Dept.Cluster_ID) ON Department.Dept_ID = Cluster_Dept.Dept_ID) ON Source.ID = Cluster_Dept.ID
GROUP BY Clusters.Cluster_Desc, Department.Dept_Desc, Source.Original_Source, Source.Headline, Source.Issue, Source.Analysis, Source.Action, Source.Day_Month_Year;

View 1 Replies View Related

General :: Update Records From A New Window?

Mar 1, 2013

I am trying to UPDATE records from the Master form by clicking a button to a new window -

frmCustomerMaster (main form) - a button will trigger to UpdateCustomerMaster new window and pass all the data to the new window.

UpdateCustomerMaster (New window Form) On Submit Update values.

frmCustomerMaster (main form) - is currently locked by properties, I do not want main form to be editable.

how to pass the data to new window and how to update the records?

View 8 Replies View Related

General :: Assigning Records From One Table To Another?

Dec 2, 2013

Database has a form to add a new item. This info is stored in the Item TBL. There is also a table that lists available UPC codes called UPC TBL. When a user enters a new item a dialog box will give them the choice to add a UPC code for that item. Clicking no - nothing changes and user return to the original form (no brainer) But if they click yes what I need to happen is:

1. The next available UPC code in the UPC TBL is entered into the Item TBL field for UPC.

2. The UPC TBL is updated to remove the assigned UPC, leaving it ready for the next assignment.

3. - and for another day - I need to create a message when the UPC table is empty because all UPC's have been assigned.

View 7 Replies View Related

General :: Reset Database To Have No Records?

May 18, 2014

Is there any way to reset a database to have no records (start again) ?

View 1 Replies View Related

General :: Copy Database With No Records

Aug 6, 2013

I'd like to be able to show recruiters the database as an example of my work (to get an interview, etc.). Of course, I can't just show them a copy of the database with all of the private information on it, so I'd like to be able to show them a copy of the database with no records. Is there a way to export/copy it so I can do this in Access 2007?

View 4 Replies View Related

General :: No More Records Available To Give Message

Dec 11, 2013

I have a table that is a list of available UPC codes that through forms are being assigned to several different tables (types of items). When the UPC code is assigned, there is a yes/no box which is checked. I need to have a message box appear when the last of these UPC codes has been used (or better yet perhaps when there are a specific number left - such as 10 - so the user isn't all of a sudden locked out of any more work).

It could even be triggered when a specific UPC code is reached - they will be in numerical order (ignoring the check digit). Is there anyway to do this globally or would the check need to be on each form as the UPC is assigned?

View 6 Replies View Related

General :: Query Last 10 Unique Records

Apr 9, 2014

I got a large transaction file with deplicated records!! For unit price checking, I need to copy the last 10 unique records to another file with the same criteria but price is not the same as the current checking record.

For instance, I got 5000 records with around 400 records unit price is not the same as history. For each checking, I needed to copy the same criteria historical records to a tempory file and then delete corresponding duplicated records first, following by another deleting action only to keep the last 10 records according to date field.

View 2 Replies View Related

General :: Taking Two Records And Combine Them Into One

Jul 20, 2012

So I have two tables. One table "tbl_SRVASSET" lists out servername, serialnumber and asset tag. Second table "tbl_SRVNIC" list out the same servername, IPAddress and IPAddressTypeDesc.

The issue is that I have records in the "tbl_SRVNIC" with the same server listed numerous times (because it has 2 or 3 NIC's). So there is obviously a one to many relationship betweeen the two tables (common I guess). What I'm trying to do is be able to take the servers in the "tbl_SRVNIC" table and a new table or create a query with a single record for that server and have all 2, 3, 4 or maybe more IPAddress's assigned to them listed in the same record. This is what I'm having trouble with...

The end result is that after I've got this new table that lists only a single server and it's associated NIC's in the same record I can then combine that data with the "tbl_SRVASSET" via a basic query so my end result is a brand new table "tbl_SRVDETAIL" that looks like this:
SERVERNAME, SERIALNUBMER, ASSET, SERVER NIC1 IPADDRESS, SERVER NIC1 IPADDRESSTYPE DESC, SERVER NIC2 IPADDRESS, SERVER NIC2 IPADDRESSTYPE DESC, SERVER NIC3 IPADDRESS, SERVER NIC3 IPADDRESSTYPE DESC, (and maybe more columns if there are more, but that is a variable as some servers have 2 NIC's, Some with 3 or more so...).

View 1 Replies View Related

General :: How To Reference Original Records ID

Apr 8, 2014

So I have a list of records in a continuous form. Within that record is a checkbox called GRT. GRT stands for Gross Receipts Tax, when it is checked I have an after update event that adds a new auto-generated record for the GRT entry. The new record copies the date from the origional record, calculates GRT from the origional records amount field and some other things like that to create the new record. Creating the GRT record entry has went well.

But, if the user removes the GRT checkbox from, or deletes the origional record, I need to delete the corresponding auto-created GRT record. I thought I could do this by simply grabbing the origional records ID and copying it into the auto-generated records field called "AssociatedID".

Problem is, when I reference the origional records record ID, it always comed in as "-1". I can display the ID on the form and it shows correct, but if I msgbox the records ID, it shows as "-1". I cannot figure out how to capture the origional records ID so I can insert it into the new auto-generated record so the two records are linked so I can later use that link to delete the proper associated record.

How do I reference the original records ID.

View 4 Replies View Related

General :: Deleting Unneeded Records

Sep 28, 2014

I created a database to track test requests from engineers. They fill out a form and things work from there. Well to increase the speed of them inputting requests, because some are virtually the same, with the exception of one item, I use a a copy record query. This works fine because after I run that I run an update query that changes the information that needs to be changes.My issue is that sometimes the user creates one too many requests. So the last copy query isn't needed. What I would like to do is somehow when they leave the form or access is to delete the unnecassary record. It doesn't come up as a new record and since nothing has been changed the form ins't dirty either. how to check if this record is meant to stay without asking the user.

I certainly have methods at my disposal that I can use along with interations from the user to get the results I want. I am just trying to avoid this if I can. I am just wondering besides checking if its a new record or if its dirty what other options do I have, if any?

View 2 Replies View Related

General :: Add Records To Many Linked Tables While Seeing Them All

Jan 17, 2013

I'm new to Access2007. I created 5 tables all related to each other in series with one-to-many joins (type 2 and all enforcements on).So an Id in table 1 can show up several times in table 2, and the same is true from tables 2 to 3, 3 to 4 and 4 to 5.I want to enter new records in such way that I can see all tables at once. I tried to do that with a query, but I can only modify records, not add new ones.I have no problem adding records to individual tables but have not figured out how to do it to this All-tables query.

View 2 Replies View Related

General :: Sub-Clients For Records In Table

Jul 3, 2013

I have a table that contains clients. There are a few select times when there will be one client organization but I will need to have two entries--say when one department has a separate contact & record of events than another department.

In most cases these separate departments can be treated as entirely separate clients however in some ways they should be counted as one--such as when counting the number of clients that we serve.

What is the best way that I can accomplish this?

My current idea is that when this situation arrises I have some type of command button that will create a new client record in the table, copy the information from the first record, then I can change it as need be.

I don't know if this is possible, how to do it, and how to set up queries that will recognize the two entries as one record. I don't even know if this is the best way to do it

View 2 Replies View Related

General :: Autocomplete Records From Different Forms

Mar 21, 2014

I have create some forms which have some common fields, I have built relationships between them as well and I want to autocomplete the records in the fields with the relationships. For example I have a form with the client's details and I have install a Macro so that when I have complete the form with the new clients details and click on the Macro to automatically open the form with the clients order where this form has the clients ID and Name which are common with the fields in the Client's form. What I am trying to do is to autocomplete the common fields when I click the Macros to open the Order list.

View 2 Replies View Related

General :: Create Multiple Records From One

Jun 19, 2012

I have three tables:

tblClient (for basic client information),
tblDischarge (for client discharge information), and
tblAppointments (for appointments that are added to an outlook calender).

All three tables are linked using the IDNumber from the Client table. I have a form where a user inputs a discharge date for the client.

Once that date has been added I need to add 5 records to the Appointments table for different followup times based on that discharge date (such as one month, two months, three months, etc.).

I have the code working to add an individual appointment to outlook but not 5 different ones at one time. So the question I have is how to add the 5 records based on the one discharge date?

View 1 Replies View Related

General :: Loop Through Listbox Records

Feb 15, 2014

I am looking to loop through all of the rows in a listbox. For each row in the listbox, I want to check if the last name in the Labor column is contained in any records in the Labor column of a recordset. If it is contained, add the column value to a variable to eventually be shown in another listbox. It seems that the loop is not working correctly and the EstHours is always 0 and the instr function doesn't seem to be working.

Code:
Sub ScheduledHours()
'on error goto errorhandler
Dim LastName As String
Dim FullName As Variant
Dim EstHours As Long

[Code] ......

View 3 Replies View Related

General :: Saving Records In Alternative DB?

Jul 6, 2012

I have a stock db with records that go back to 2006. I want to clear some of the old records but save them incase required. I still need to leave from 2010 until present on the db. I have a front and back end on the db.

View 1 Replies View Related

General :: Records Locking - Won't Allow Updates

Nov 8, 2013

Using 2010 32 bit on win 7.I've been having an issue recently with forms not allowing changes to existing records or adding new records. These have previously worked for years and I haven't done any design changes in 12 months.

Some forms are base on queries that are based on single linked tables and some on joined queries but all have unique identifiers with enforced integrity.I noticed that changing the Record Source in the form from 'Dynaset' to 'Dynaset (Inconsistent Updates)' resolves the issue. But I'm stumped to what's causing this to happen in the first place.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved