Results 1 to 7 of 7
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Email program in MS Access is not working

    In one of the attached zip files there is database which when you open a certain form will allow you to send an email. The form is frmEmail and it allows one to view a certain person's activities and then to send them an email if there is something important that they should know such as an upcoming meeting, etc.



    Now I have this part of the db working before, but as I said in a post yesterday, I have not used or tested the db for several months. When I use it now, I get a error : invalid use of null.

    I am not sure what is causing that and hence the purpose of this post.

    This button to send the person an email should open up and email with said person's email address and space for the body of the email. It should also allow the sender to even add an attachment if they wish.

    It does do any of these at the moment all it does is give the error message that I listed above.

    One should also know that this system only works on MS OutLook so it may be hard to replicate if one is not using MS OutLook for email.

    I should also state that the coded to send the email compiles and does send an email, why it is not doing so now is a mystery.

    I am using MS Access 2010.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    Attached Files Attached Files

  2. #2
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, I think that I found a way to make the email from work, so I am changing the question. If I select an employee from the combo box it will open the from to send an email. If I just take whatever is there when I
    open the frmEmail, it will generate a invalid use of null.


    I can see why if would fail since the VBA code uses cboEmployee, but why do I have to select it. the combo box already has a name and I just chose to send it instead of selecting one and then choosing to send an email.

    So that is my new question on this forum. Why must I select the Employee's name first?

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou_Reed

  3. #3
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I think that I have found a way to repair this wrinkle in the db program. It would not be fair to call it an error. This will make the form a little harder to use, but since when should forms be easy to use?

    Again consider the form as shown in the attached jpeg file. it defaults to a name : Peter Cushing.

    I am not sure why it chooses that name - it does.

    Is there way to make the combo box show no name or a blank in the name slot so a use will be forced to choose a name? The would make everything alright.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou_Reed
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The Null is because no value in the employee combobox. The combobox AfterUpdate event is setting the combobox back to empty string. The email procedure references the combobox for the employee name. Change code to reference txtName textbox.

    strBranchhead = Me.cboEmployeeName

    should be

    strBranchhead = Me.txtName
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    That loosk like it will work. Of course, Me.txtname must have a value for it to work.

    Thanks very much, I will give it a shot.

    Respectfully,

    Lou Reed

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Well, if there is any chance any of the fields will be null and you want to prevent the email code from executing, use If Then Else conditional structure.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Thanks, I think that I will.

    Respectfully,

    Lou Reed

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

Similar Threads

  1. email program fails with invlaide use of null
    By Lou_Reed in forum Access
    Replies: 40
    Last Post: 06-12-2017, 11:30 AM
  2. Email from Access no longer working
    By Gina Maylone in forum Access
    Replies: 4
    Last Post: 10-12-2016, 06:46 AM
  3. Replies: 1
    Last Post: 12-27-2014, 12:38 PM
  4. access program not working properly!
    By accesshelpme in forum Access
    Replies: 1
    Last Post: 05-13-2012, 03:43 PM
  5. Program Link to Outlook Email from a Buttom
    By taimysho0 in forum Programming
    Replies: 7
    Last Post: 11-23-2011, 02:07 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