Results 1 to 2 of 2
  1. #1
    IvanGAa is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2020
    Posts
    1

    Prevent duplicate value

    Hi Community;

    I'm a relatively new in programming overall... I hope one of your can assistance me to solve an issue related to macros in access.. so I got this query of an Assets leased, it is a relational query that involve an asset linked to an employee.

    Here some details:

    One employee can be have many assets leased.
    One asset only can linked to an employee.

    For that reason I got an main menu with Assign Asset, return asset for opening those forms.

    In te assign asset I'm assigning asset to an employee, but I'd like to know how to prevent that an asset without a record of return:

    The form of the return of asset only add the return date and put that record in "Inactive", and the form of assign request the ID of employee, asset, date of delivery and put the device in "Active".

    I've attached some image of the macros that I'm using in button save and new for do that, and images of the project.

    I hope anyone can give a way how to do this.

    Thanks

    Click image for larger version. 

Name:	2020-03-10 08_12_39-Access - RF_Tracking - Copy _ Database- C__Users_iapolinar_Documents_RF_Trac.png 
Views:	20 
Size:	15.9 KB 
ID:	41246Click image for larger version. 

Name:	2020-03-10 08_11_24-Access - RF_Tracking - Copy _ Database- C__Users_iapolinar_Documents_RF_Trac.png 
Views:	20 
Size:	18.3 KB 
ID:	41247Click image for larger version. 

Name:	2020-03-10 08_11_43-Access - RF_Tracking - Copy _ Database- C__Users_iapolinar_Documents_RF_Trac.png 
Views:	20 
Size:	63.2 KB 
ID:	41248Click image for larger version. 

Name:	2020-03-10 08_11_56-Lease.png 
Views:	20 
Size:	9.9 KB 
ID:	41249Click image for larger version. 

Name:	2020-03-10 08_12_06-Access - RF_Tracking - Copy _ Database- C__Users_iapolinar_Documents_RF_Trac.png 
Views:	20 
Size:	12.9 KB 
ID:	41250

  2. #2
    Join Date
    Apr 2017
    Posts
    1,234
    You must have a tables:
    tblEmployees: EmployeeID, ForeName, LastName, ... (a field for every non-changeable characteristic about this person your database needs);
    tblAssets: AssetID, AssetType, AssetInfo, ..., AssetStatus (an optional table, as by conditions you did write down an asset may be linked only to single employee;
    tblEmployeeAssets: AssetID, EmployeeID, [AssignedAt] (AssignedAt is optional date field. In case you don't use tblAssets, you have all fields from tblAsset in this table instead.).

    In table tblEmployeeAssets, set AssetID as primary key (i.e. it will be unique).

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

Similar Threads

  1. How do you prevent duplicate records?
    By cwjakesteel in forum Database Design
    Replies: 28
    Last Post: 11-28-2016, 09:05 AM
  2. Prevent Duplicate Entries
    By Abhijeet in forum Forms
    Replies: 2
    Last Post: 08-23-2015, 12:15 AM
  3. How to prevent duplicate data
    By ariansman in forum Forms
    Replies: 2
    Last Post: 08-11-2015, 06:25 AM
  4. How to prevent duplicate records
    By talktime in forum Programming
    Replies: 7
    Last Post: 05-15-2013, 11:02 PM
  5. Prevent duplicate dates
    By bishop0071 in forum Access
    Replies: 1
    Last Post: 01-09-2013, 09:04 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 - Senior Forums