Results 1 to 2 of 2
  1. #1
    MrBeardo is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    2

    Instant Search with textbox in Form

    Hi,

    I apologise for all I am asking, but I am a little rusty (about 12 years since I last used Access), and I am slowly getting back to grips! Things were a lot different back then!

    I also apologise for any confusion as I have Aspergers, and sometimes say things in my head instead of communicating what I wanted to say!

    Iam trying to develop an "Internal Email" form to email [Employees] using Gmail via a module.

    So far I have made a table of emaployees and picked a macro from this forum.

    There are lots of things I need to know how to do, but mainly I need a search utility for multiple fields from records in a table that will allow the user to place a different field associated to the record found/selected by the user
    ie: search [firstname] & [lastname] fields, and upon selecting required record from query results, output [email] field to a textbox (may likely need results that can be used as multiple selections with comma seperated outputs upon selection)

    My overall goal here is to create a textbox in the form that will look up the [FirstName] and [SecondName] fields at the same time, and (if not too much work for you!) show the results as you type as a checklist.

    in other words I want the results to display as a tickbox selection list with the results like so:
    Table field data:
    [FirstName] & " " & [Lastname] "(ID: " & [EmployeeID]
    Text Output:
    □ John Smith (ID:1)
    □ John Doe (ID:2)

    When this list comes up, I would like to be able to select multiple names that when selected, will have each record's respective Email address [Email] added into a "To" textbox, ready to be read by the email module for when the email is sent.

    I am also having trouble with the button I want to use to send the email, I cannot seem to figure out how to get the macro I am using to identify the [To], [Subject] & [Body] details.

    Here is my module (as you can see I have tinkered with it a little, and this was working when I first made my form in the simplest setting):

    Public Function send_email()


    Set cdomsg = CreateObject("CDO.message")


    With cdomsg.Configuration.Fields
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'NTLM method
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 465
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "benjamin.goddard@gmail.com"
    .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "forgetm3n0t"
    .Update
    End With
    ' build email parts
    With cdomsg
    .To = EmployeeEmail.EmailTo, "benjamin.goddard@gmail.com"
    .From = "ben@leeli.co.uk"
    .Subject = EmployeeEmail.EmailSubject 'was with "subject here"
    .TextBody = EmployeeEmail.EmailBody 'was "the full message body goes here. you may want to create a variable to hold the text"
    .Send
    End With
    Set cdomsg = Nothing
    End Function




    You might also notice I set the Email button to save a record of the Email, as eventually I will be making a complete email suite with an inbox and outbox etc

    Anyway, I have made a new Database and imported the stuff that you might need to look at to help!

    Thanks in advance peepz!

    Ben
    Attached Files Attached Files

  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,640
    Personally I would probably have the textbox change the source of a listbox, and let the user select from the listbox. Your reference to the form is off:

    Forms Refer to Form and Subform properties and controls
    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: 12
    Last Post: 06-08-2012, 02:37 AM
  2. Replies: 12
    Last Post: 03-22-2012, 02:48 AM
  3. Replies: 17
    Last Post: 02-08-2012, 10:06 AM
  4. Replies: 9
    Last Post: 02-15-2011, 03:05 PM
  5. Instant load of a form
    By carstenhdk in forum Forms
    Replies: 2
    Last Post: 05-06-2010, 12:27 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