Results 1 to 9 of 9
  1. #1
    bratby1980 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    5

    Simple Database, 2 tables

    Hi,

    I am trying to create a basic database using access but I'm still learning at the minute.

    I have a text file which contains: customer account code (contains duplicates), customer address type, customer name, and telephone number.

    I have created a table by linking to this source file. (If I refresh this file in the future will I lose any data that is linked to it?, if that makes sense). I have created another table for CustomerRegNo and EmailAddress. I don't know how to link these tables together?

    I want a form which the user can find a certain record by customer account code, then add a Customer Registration Number and an Email Address.

    Sorry I have tried to do this myself but haven't got the foggiest. Can't seem to do anything with the linked table.



    Thanks in advance,

    Dave

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    If the text file is replaced with another file using same name, the link should remain intact.

    Will not be able to edit the text file through link. Same for linked spreadsheet.

    If these datasets do not have common field(s), there is no way to associate records from each. So unless CustomerAccountCode and CustomerRegNo are the same data, these datasets have no relationship. Need a field in table for saving CustomerAccountCode.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    bratby1980 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    5
    Hi,

    Thanks for the reply.

    So, in the same table as the CustomerRegNo and EmailAddress I need to put another field for CustomerAccountCode?

    Dave

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Seems so. Then have a form bound to table with subform for the linked text file. Have UNBOUND combobox in main form for searching CustomerAccountCode. If entered code not found, create new record on main form. This can be handled programmatically from the combobox NotInList event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    bratby1980 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    5
    Thanks again,

    I'll have a look in to subforms. I'm still stuck on how to link the 2 tables together.

    Dave

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Already described what you need in order to link the datasets.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    bratby1980 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    5
    Brill! I got it working.

    Thanks again for your help.

    Dave

  8. #8
    bratby1980 is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    5
    Hi,

    I have just come across another problem. I want the user to be able to update the phone number and show the latest phone number.

    I have added a PhoneNumber field to the table with the EmailAddress & CompanyRegNo & CustomerAccountCode and linked it in the subform. When I change the phone number in the sub form it just reverts back to the one from the text file. How do I keep the latest phone number on display?

    Thanks again,

    Dave

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    My suggestion was main form bound to table and subform bound to linked text file. The subform can display the associated records from the linked text file but cannot edit that data. So why are you trying to change the phone number from the linked text file? Change data on the main form.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-31-2014, 02:18 PM
  2. Replies: 1
    Last Post: 05-08-2013, 07:08 PM
  3. Very simple link two tables
    By dumbledown in forum Queries
    Replies: 12
    Last Post: 03-23-2012, 10:33 AM
  4. Really simple database
    By aveit in forum Access
    Replies: 3
    Last Post: 03-23-2011, 04:43 PM
  5. Simple Question about Referring to tables
    By KIDRoach in forum Access
    Replies: 4
    Last Post: 06-19-2009, 07:34 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