Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 41
  1. #16
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652

    With the row source in design view, run the query. How many fields do you see being returned?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Yes, of course I am.. That was done so four columns become three. I am still confused as to what each columns refers to. I think the only way to tell is by recreating the combo box.

    Column 2 is bound.

    Any hep appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  3. #18
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    When I do that I see three columns with a column for fullname which is concatenated out of 2 columns.

    The method that you describe (run row source in query design view) I have used before. it is just that being a newbie sometimes you forget.

    So as I stated earlier four columns becomes three columns, but I am claiming that there are four columns in this combo box. That must be before concatenation of the two columns into one column - fullname.

    Please continue.

    Respectfully,

    James M. Yunker

  4. #19
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    What's relevant is how many are "visible" to the combo, which is 3 columns. In other words, it's the result that matters, not how many fields might have been used to achieve that result.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #20
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Now must select the appropriate column from the output. The make sure that I have no mismatch. After that it should work. How cone strWho in the old code came out as "". Surely, the column that I chose for it had something in it - it was not null.

    Any help A=appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  6. #21
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I refer you back to post 13 (and earlier threads). You don't need the DLookup(), you already have the email address in the combo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #22
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, but if i do not need DLookup, explain why.

    Also, as I said when I walk through the code I get strWho ="". In that code I was selecting column 1 is name and name is not null. So why do I get strWho=""?

    It just seems incorrect?

    I did not get type mismatch, I got invalid use of null. Yes, StrWho was null.

    What line did you get a type mismatch?

    I am attaching a picture of the relevant source code.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    Attached Thumbnails Attached Thumbnails Capture30.PNG  

  8. #23
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Isn't the email address of the person selected in the combo in a different column of the combo? Why use a DLookup() to go get it when you already have it? Did you read post 13?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #24
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    It is. But please tell me in my old code, why is StrWho=""? The column from which it got its value certain;y is not null. So why StrWho=""?

    Where did you get type mismatch during execution? I got the error: invalid use of null, not type mismatch?

    It just doe not seem logical.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  10. #25
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    At what point are you looking at it? It returns the person's name in the sample. This returns the email address:

    Me.cboEmployeeName.Column(2)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #26
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    It does not on my run. It just returns, StrWho = "" after I go to the line

    strWho = Me.cboEmployeeName.Column(1)

    in the code attached above. Then it says strWho=""

    That is why I thought there was an error. It certainly did not run the program, it only crashed with an "invalid use of null" error.

    I am not sure why you got a different error.

    Respectfully,

    Lou Reed

  12. #27
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If you want to upload another sample, I'll look at it, but I'd really dump the DLookup() and get the address from the combo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #28
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Here is my latest version of the db. If one tries to send an email from frmEmail, it will crash with "invalid use of null."

    The email system that I use is MS Outlook.

    Any help appreciated. Thanks in advance.

    I am attaching the zipped file of the db and a Snagit shot of the code where it fails.

    Any help appreciated. Thanks in advance.

    Respectfully,
    Attached Files Attached Files

  14. #29
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Not sure what you mean by it fails. Do you realize that at the point the code is stopped, the highlighted line has not executed yet? Hit F8 to advance a line and see what strWho contains then. I still get a data type mismatch, because you're still comparing name to ID. And I'd wouldn't use the DLookup(() any, for the umpteenth time:

    ?Me.cboEmployeeName.Column(2)
    Christopher_Lee@yahoo.com
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #30
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Yes, I am avoiding using the DLookup(). I just want it to at least get a value for strWho. Something like strWho="", just does not work. It is reading a column and it is not taking that a value. In fact it is not taking any value at all. Forget about type mismatch why is it not taking the value at all? That is my question. The avoidance of DLookup() is something that I will worry about once I get this solved.

    Respectfully,

    Lou Reed

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 03-11-2017, 09:48 PM
  2. Access2010 - email automation (if not NULL)
    By MikeDub in forum Access
    Replies: 3
    Last Post: 12-18-2014, 07:34 PM
  3. Replies: 5
    Last Post: 05-07-2014, 09:25 AM
  4. Program Link to Outlook Email from a Buttom
    By taimysho0 in forum Programming
    Replies: 7
    Last Post: 11-23-2011, 02:07 PM
  5. Program a 30-day trial into my Access Program?
    By genghiscomm in forum Programming
    Replies: 1
    Last Post: 05-26-2011, 02:14 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