Search results

  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...
  16. L

    after update condition effects all records on form

    Hi, I have a form which will list all records relevant to the user selected from a list. Multiple records are displayed at one time in a list view. I have an after update expression on one field whereby if it is not null then two subsequent fields are disabled to prevent them from being...
  17. L

    disable fields on checkbox true

    Hi, apologies for over using this great forum the last few days.... I want to disable or lock fields on a form should a checkbox be true. I am just trying this out on the next field after the checkbox so far and have - If Not IsNull (Me.Check136) Then Me.Passed_to.Enabled = False Else...
  18. L

    if checkbox true set other field to null

    Just tried it, it worked :O Thanks!
  19. L

    if checkbox true set other field to null

    Hi, I have a checkbox and a date field. I want an expression (after update on the checkbox I guess) where if the checkbox is true then the date field should be set to null. Something like If [checkbox] = true then [response_date] = null I'm still trying to learn the syntax. Any help much...
  20. L

    Filter form on drop down box selection on button click

    Thank Bob, hoping there was an easier way. It's a pretty simple database so I've based it on one table with lookups. Cheers though I'll probably have to restructure it.
Back
Top Bottom