Results 1 to 10 of 10
  1. #1
    dr4ke1990 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    52

    Tick Boxes = WHERE clause


    At frequent points throughout every month I have to email customers to make them aware of maintenance; the current set-up is to manually pull out each persons email address from a big list and email them... very time consuming!

    what I would like to do is set up a Table with the customer name and the email address of the customer (multiple lines if more than one email address). My plan is then to create a form with all customer names (derived from the table itself using a DISTINCT function) and a tick box next to the name, if the tick box is checked next to the customers name it should feed into a query WHERE and display only those customers.

    Is this possible?

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    Yes that all sounds possible

  3. #3
    dr4ke1990 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    52
    Quote Originally Posted by SoftwareMatters View Post
    Yes that all sounds possible
    Are you able to offer some assistance ...?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by dr4ke1990 View Post
    Are you able to offer some assistance ...?
    I would suggest starting with your table design. If you have more than one email associated with an account you probably have more than one contact name associated with an account. Perhaps there is a need to have two tables to keep track of these entities. One table to describe the account and another table to describe the individuals associate with the account.

  5. #5
    dr4ke1990 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    52
    This is how I envisage the table looking (below). So I'd like to have, in this example, 4 customer names and 4 tick boxes; the query would then pull off the customers that have their tick box ticked..

    ID CustomerName PersonName PersonEmail
    1 Customer1 Person1 Person1@domain.co.uk
    2 Customer1 Person2 Person2@domain.co.uk
    3 Customer1 Person3 Person3@domain.co.uk
    4 Customer2 Person1 Person1@domain.com
    5 Customer2 Person2 Person2@domain.com
    6 Customer3 Person1 Person1@domain.com
    7 Customer4 Person1 Person1@domain.com

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I envision something like....



    tblCustomers

    CustPK
    CustName
    CustAdd1
    CustAdd2
    CustCity
    CustState
    CustPostal
    etc....

    tblContacts

    ContPK
    CustFK
    ContFirst
    ContLast
    ContGender
    ContPH
    ContMobile
    ContEmail
    etc.....

  7. #7
    dr4ke1990 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    52
    I don't need all of that information; I only need what I posted above...

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by dr4ke1990 View Post
    I don't need all of that information; I only need what I posted above...
    tblCustomers

    CustPK
    CustName


    tblContacts

    ContPK
    CustFK
    ContName
    ContEmail

  9. #9
    dr4ke1990 is offline Advanced Beginner
    Windows 7 32bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    52
    Ok - so how do I make the tick boxes to form part of the Where clause? I am comfortable with what I want my tables to be.

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    OK, how about this?

    tblCustomers
    CustID_PK Autonumber
    CustName Text
    IsSelected Y/N (boolean)


    tblEmailAddress
    EmailID_PK Autonumber
    CustID_FK Number - Long (Foreign Key to tblCustomers)
    sFName Text
    sLName Text
    sEmail Text


    Query to select customers:
    Code:
    SELECT tblCustomers.CustID_PK, tblCustomers.CustName, tblCustomers.IsSelected
    FROM tblCustomers
    ORDER BY tblCustomers.CustName;

    Query to get emails:
    Code:
    SELECT tblCustomers.CustName, tblEmailAddress.sFName, tblEmailAddress.sLName, tblEmailAddress.sEmail
    FROM tblCustomers INNER JOIN tblEmailAddress ON tblCustomers.CustID_PK = tblEmailAddress.CustID_FK
    WHERE (((tblCustomers.IsSelected)=True))
    ORDER BY tblCustomers.CustName;

    Would also need code to set "IsSelected" to FALSE every time the form is opened.

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

Similar Threads

  1. how to add tick boxs to filter
    By sspreyer in forum Programming
    Replies: 1
    Last Post: 11-05-2013, 09:13 AM
  2. Tick Box in a Query
    By Cran29 in forum Queries
    Replies: 1
    Last Post: 06-15-2012, 05:33 PM
  3. Replies: 5
    Last Post: 05-05-2012, 10:11 AM
  4. Tick Box Hides Text Box
    By Arrrggggjhhhhh!!!! in forum Forms
    Replies: 4
    Last Post: 02-29-2012, 10:42 AM
  5. Password on a Tick Box?
    By wadey in forum Security
    Replies: 1
    Last Post: 04-25-2011, 12:40 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