Results 1 to 6 of 6
  1. #1
    Krakhis is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    2

    New to Access - Help with Form that pulls data from 2 tables with no relationship

    Good day everyone.
    I'm a little bit new to access (okay a lot a bit new) and I have been tasked with creating a program/form/query that can pull data from 2 tables, and based off that data, give the option to email certain persons.
    I did not create this database, just been asked to help out on it.



    My first table has the most raw data.
    From that table, I need to pull the ID # (autonumber), the person whom initiated it (1 field - "Lastname, Firstname"), and the date.

    My second data has information about persons.
    From that table, is where I run in to my issue. That table is set up with 1 field for FirstName, 1 field for the LastName, and 1 field for the email.

    I'm at a loss how I can pull data from the first table, "LastName, Firstname", and combine and compare it to the data of the second table, "Lastname" & "Firstname".

    Do I need to add a field to one of tables and combine them?

    Any and all help would be greatly appreciated,
    Thank you.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Ideally the 2nd table would have a Foreign Key field (Long Integer) with the 1st table's ID# in it. Lacking that you can concatenate the fields from each table in a query and do the compare. You've got a problem if they're spelled differently.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    1 field - "Lastname, Firstname"
    This I would not do. One field for first, one for last. The first suggestion given by RG is the best option IMHO. Names aren't a great identifier anyway. You really can't make either field unique as you should allow for 2 John's. Nor can you make Smith unique; nor can you make a unique index on them, since you should allow for 2 John Smiths. If you have unique employee id's, I suggest you have that in the first table and in the second, have that long data type field which is the autonumber for the employee which comes from the first.
    Suggest you read up on some of these sources if you're really new to Access. They may save you headaches later.
    http://access.mvps.org/access/lookupfields.htm.
    http://access.mvps.org/access/general/gen0025.htm
    http://allenbrowne.com/AppIssueBadWord.html
    https://access-programmers.co.uk/for...d.php?t=225837
    http://www.utteraccess.com/wiki/index.php/Autonumbers
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Krakhis is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2017
    Posts
    2
    Thank you RuralGuy and Micron for responding.

    Just want to point out 2 things again quickly before I respond so you understand where I am coming from. I am still rather new to access (strong experience in Excel & VBA coding), and this is an already built database that has been used with about 4000 unique entries in the first table.

    I have been watching and reviewing info about access, and would completely have done this database differently - Better naming convention and some actual relationships (which in this DB there is none).

    To Rural: I do not understand which ID number I would use? for each entry or? And I understand your remark about the names being off, the form is built using drop downs, which saves me from misspellings, but I'll have to look in to comparing the queries.

    To Micron: I completely understand why you would not do it that way. The second table though is small and is tied to a small group of people, so the chances that we would hit 2 names with the same spelling is extremely small, but I understand for future reasons, it may become an issue. Thank you very much for the sources! I have been looking over them and there is a lot of great info, though your last link seemed to fail?

    Thank you again for the help and suggestions!

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would try running a query comparing the 1st table field "Lastname, Firstname" to the 2nd table Foo:= [LastName] & ", " & [FirstName] and see if you can get some compares.

  6. #6
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    Perhaps they moved the thread, but it was discoverable from there. I'll update my bookmark - thanks for the info
    http://www.utteraccess.com/wiki/Autonumbers

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

Similar Threads

  1. Creating a Form that pulls up data
    By Accu-Grind in forum Forms
    Replies: 6
    Last Post: 04-09-2015, 10:21 AM
  2. Replies: 5
    Last Post: 11-26-2013, 11:11 PM
  3. Replies: 10
    Last Post: 08-21-2012, 07:16 AM
  4. Form pulls info from 2 tables.
    By Jonpro03 in forum Forms
    Replies: 6
    Last Post: 07-20-2011, 11:33 AM
  5. Replies: 1
    Last Post: 02-13-2010, 12:44 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