Results 1 to 8 of 8
  1. #1
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179

    How to get IDs For AFRs Table ?

    I seem to have redundancy according to the experts here and improper normalization.

    In my AFRs table there are for instance ClerkID and Clerk and probably should just be a field for ClerkID. There are others also.

    My question is how to get the ID numbers for these fields from the other tables? I will eventually remove the similar fields that are not IDs.



    Thank you

  2. #2
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    I am sorry for the trouble. I will export to Excel and use formulas to get the IDs.

    Thanks anyway

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    An example

    If you want to populate the TechnicianID field based on the Technician text on the AFR table you would run this query:

    UPDATE AFRs INNER JOIN Technicians ON AFRs.Technician = Technicians.Technician SET AFRs.TechnicianID = [Technicians]![ID];

    You'd just have to run something similar for each foreign key you wanted to update.

  4. #4
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    Thanks but I have no idea what that is or how to run a query.

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    ... how can you be building a database and not want to deal with queries? They are an essential part of any database.

    Your database has a series of tables and a couple of forms that's just scratching the surface of what a database can do and if you limit yourself to those two items you're not going to have a robust system.

    To create a query click the CREATE menu option to bring up the create ribbon
    Select QUERY DESIGN
    Click CLOSE on the SHOW TABLE window pop up if you get it
    Click the SQL VIEW in the upper right corner of your query window
    Paste in the code I gave you
    Change to the DESIGN VIEW of the query in the upper left corner of the query building window

    you'll see a very simple query design for updating the technicianID field.

  6. #6
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    Thank you that worked very well. I need to do this for the other fields too. It may take some time and hopefully I can accomplish the edit.

    Cheers!

  7. #7
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    Okay I made queries for the other fields and now the AFRs table has all of the IDs.

    Thank you very much for the help.

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    You bet, make sure to mark your thread solved

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

Similar Threads

  1. Replies: 1
    Last Post: 03-31-2016, 03:33 AM
  2. Replies: 4
    Last Post: 08-30-2012, 07:58 PM
  3. Replies: 8
    Last Post: 03-22-2012, 08:48 AM
  4. Replies: 2
    Last Post: 08-01-2011, 11:35 PM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 AM

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