With the row source in design view, run the query. How many fields do you see being returned?
With the row source in design view, run the query. How many fields do you see being returned?
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
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
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.
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
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.
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
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?
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
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)
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
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.
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,
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
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