Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2004
    Posts
    62

    Unanswered: Automatic searches

    Hi,
    Is it possible to get each entry in a particular field in a table to be put into a search?

    Then I would like the product of this search to perform another action. If it is 'yes' then would it be able to send an email automatically?

    Thanks
    Sue

  2. #2
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Are you wanting to just see all of your employee's names?
    Ryan
    My Blog

  3. #3
    Join Date
    Jul 2004
    Posts
    9
    If outlook is your mail client

    you could use vba code to initiate an email automatically.

  4. #4
    Join Date
    Apr 2004
    Posts
    62
    I want each entry of one field to be put into a search that I have already set up automatically. So the first is enter and gives me a result. If the result is yes then it will send an email. Then the next entry goes in the search and so on?

    I thought about the VBA code but I have no idea how to write it and I need to set up the other thing first I think? but thank you!

  5. #5
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Question

    Hm. I just dont get what you are trying to do. What is ths "search", a sql query? Could you post the code and field namens/table names? Please specify how/where you want the output.

    D.
    Win-XP pro, Access 2002, ADO 2.7, DAO 3.6. English versions of apps/OS.

  6. #6
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Yeah, I am confused also now...Maybe he wants to look for apple and if somebody bought one, send a mass email??
    Ryan
    My Blog

  7. #7
    Join Date
    Nov 2003
    Location
    Europe
    Posts
    369

    Question

    what is "automated", could you describe, or better post some code or something? Real examples, even half-done is a good starting point so we can spend our time on the solution rather than trying to figure out what this is about .

    D.
    Win-XP pro, Access 2002, ADO 2.7, DAO 3.6. English versions of apps/OS.

  8. #8
    Join Date
    Apr 2004
    Posts
    62

    Let me see...

    I have a table called Transmission List with a field Experimental Code. This table holds all the information for each experiment. Each experiment contains 24 subsets. i.e. 286A-1D/1 - 286A-1D/24.

    I then have another table called PMbook with a field called Experimental Code that holds information for each subset as they are finished.

    So that I know when an experiment has finished I put each code manually into a query by form search. This query than takes all the experimental codes from the Pmbook that are like the search criteria. It then adds them up. If there are 24 is returns a 'yes' result.

    When is says 'yes' I then send an email to tell the relevant person their experiment has finished.

    There are over 100 experiments so I wondered if I could get Access to run down the list of experimental codes, putting each one in the query by form search and so producing yes/no's.

    I haven't written any code for this, I've just followed very simple steps to set this up. Does that make it any clearer? (oh and I know that table/field names shouldn't have gaps in!!)
    thank you all!
    Sue

  9. #9
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    Quote Originally Posted by vegprime
    If outlook is your mail client

    you could use vba code to initiate an email automatically.


    BTW It doesn't have to be Outlook. DoCmd.SendObject uses the default mail client. Yes, agreed you can programmatically open an instance of the Outlook application and have much programmatic control over Outlook but this situation doesn't seem to warrant such complexity.
    Rod

    fe_rod@hotmail.com

  10. #10
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    Sue,

    Do you have (or can you arrange to have) the recipients' email addresses in your database? Can you also include a Boolean attribute against each experiment that means Email Sent if true?

    With these attributes in place it should be quite straightforward to automate your emails. You would need to use VBA for this and the logic is then something like:

    For each experiment
    If count of subsets >= 24 AND EmailSent = false then
    Send email
    EmailSent = true
    End If
    Next

    You can attach this procedure to some appropriate event such as AfterUpdate of a subset and there you go. What will you do with all the time you save?
    Rod

    fe_rod@hotmail.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •