Recent content by lotarugg

  1. L

    Defining object in sub

    I have this below in which I'm missing the right syntax. I get 'external name not defined' error where I have tried to define Email_Date on the 2nd line. Thanks Sub EmailSent() If [Tables!Table_Date.Table.Email_Date] <> Date Then [Tables!Table_Date.Table.Email_Date] = Date Result = SendEMail()...
  2. L

    Turn button red after clicked

    Ok :) I get what you're saying but I'm still in the dark about defining the feild. The below gives 'object required' error when I try to define Email_Date on the second line. Sub EmailSent() If Tables!Table_Date.Table.Email_Date <> Date Then Tables!Table_Date.Table.Email_Date = Date Result =...
  3. L

    Turn button red after clicked

    Firstly thanks for all your help with this. You’re right that I need no output. I didn’t know the difference between functions and subs. A sub will do me fine though I’m struggling with the syntax you have provided. All I need is to make this work and it’s doing everything I need at the moment...
  4. L

    Turn button red after clicked

    Ah ok thanks,yes I want today's date without the time. But when I use result = Me.Email_date = Date I get invalid use of Me key word.
  5. L

    Turn button red after clicked

    Have this now which calls the SendEmail function if the Email_date field does not contain todays date. Only problem is "result = Email_date = Now()" does not populate the field with todays date. Any help would be great. Thanks ----------------------------------------- Function EmailSent() If...
  6. L

    Turn button red after clicked

    Thanks Simon that's what I'm after
  7. L

    Turn button red after clicked

    Yes I made it, has taken me about a year though of finding my way and doing bits now and then. How to make this code once run persistent for whoever opens the database for a day and expire from midnight? I think is going to be tricky. Thanks for help
  8. L

    Turn button red after clicked

    Hi, I have a button that when clicked sends emails to people who have had records added to the database that day for their attention. I don't want people to click it twice so I need some alert that tells people that the button has been click ie it turns red for the remainder of the day? Thanks
  9. L

    query returns data but module uses primary key

    Replaced lookup column with list - not ideal but it works for now.
  10. L

    query returns data but module uses primary key

    I'm starting to think this won't work using a lookup table, but I have to ;,(
  11. L

    query returns data but module uses primary key

    Yes to all however there is a lookup at the form level which saves the selected value into a field on the table being queried. The relationship is field to field not field to primary key. This is a relational database so surely I don’t have to do away with all relationships? I’m clearly...
  12. L

    query returns data but module uses primary key

    Good point - -------------------------------------------------- Public Function SendEMail() Dim db As DAO.Database Dim MailList As DAO.Recordset Dim MyOutlook As Outlook.Application Dim MyMail As Outlook.MailItem Dim Subjectline As String Dim BodyFile As String Dim fso As FileSystemObject Dim...
  13. L

    query returns data but module uses primary key

    Hi, I have a module that uses a query to get a list of email addresses from a table. Just running the query returns the email address - great. However the module uses the record ID of email address when placing it in the 'to' field in Outlook - so I just get a number there when i need an email...
  14. L

    insert email address from current record field

    It worked - you star! Thanks very much
  15. L

    insert email address from current record field

    Hi, I have this code DoCmd.SendObject _ , _ , _ , _ emailaddress@domain.org, _ , _ , _ "This is the subject", _ "This is the message to you", _ This is triggered on a button press on a form. The email needs to go to a person on the particular record...
Back
Top Bottom