Results 1 to 9 of 9
  1. #1
    Accessnoooob is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    5

    Creating a table with local and external data

    I am making an email function for my database. My database has a table with all the necessary feilds email, contact name, company etc. This is all in the backend of my table. Currently i added a checkbox to the table so that you can select a list of email address as the recipients. the problem is that if more than one person is using the email list they are editing the same thing.

    My solution is to create a local table (in the front end) that contains the checkbox and is linked to the contact name so that each user will have thier own local version of the table.



    My problem is that I don't know how to link the tables (one in the front one in the back-end) so that when new contacts are added to the back end the list in the front end will have the added contacts.

    Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Personally, keeping duplicate data would be my last option. I'd probably use a multiselect listbox to let the user select multiple recipients.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Accessnoooob is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    5
    Thanks illl try that

    How do I make a multiselect listbox?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Just create a listbox, and set its multiselect property appropriately. You need code to get the selected values. Here's a link which probably isn't doing exactly what you want, but contains the commonly used code to get the selected records:

    http://www.baldyweb.com/multiselect.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Accessnoooob is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    5
    I was just searching online and it seems that it is difficult to have a "select all" with the multiselect box. This is an important feature for me.

    If I wanted to do it my original way how would I link the tables? i say this since I already have it working other than the fact that everyone is editing the same checkbox list so users interfere with each other.

    so what I would like is something like this:
    Table 1 (Back end)
    Contact
    email
    phone
    fax

    Table 2 (front end)
    Contact (from Table 1)
    checkbox

    Or if I can use a query instead of table 2 that would be fine

  6. #6
    Accessnoooob is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    5
    Or table 2 could be a temporary table.. but i don't know how to do that.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You give up too easily. A select all is fairly easy. I'd just have a checkbox for it, and test that checkbox first. If checked, either loop all listbox items instead of only the selected items or loop the listbox's source.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Accessnoooob is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    5
    Ya I have a select all and a deslect all in my current version and you can look at your list and edit it after. So you can hit select all then remove a couple people from the list if you want. The last hurdle is to make this list in the front end.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You can select all like so:

    Code:
      Dim x                  As Integer
      Dim ctl                As Control
    
      Set ctl = Me.lstReservations
    
      For x = IIf(ctl.ColumnHeads, 1, 0) To ctl.ListCount
        ctl.Selected(x) = True
      Next x
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 08-23-2012, 12:28 AM
  2. Linking Access Table with already imported External Data (Excel)
    By izzarshah in forum Import/Export Data
    Replies: 1
    Last Post: 07-29-2010, 09:40 AM
  3. Form fields export to local table
    By lupis in forum Forms
    Replies: 0
    Last Post: 03-23-2010, 02:38 PM
  4. populate table w/ external data
    By tlittell in forum Programming
    Replies: 2
    Last Post: 02-20-2010, 08:29 AM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 AM

Tags for this Thread

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