Presumably when you first built it, it had 4 columns. When you change the row source to fewer columns, you need to adjust the column count and column widths properties appropriately.
Presumably when you first built it, it had 4 columns. When you change the row source to fewer columns, you need to adjust the column count and column widths properties appropriately.
In the attached db file. I am trying to access the emailaddress of the individual. I am going back to the same combo box that I used in
strWho = = Me.cboEmployeement.Column(1)
but, now it is the third column not column two, but I am getting an invalid use of null.
The cboEmployeeName has four columns. The first is the PersonnelID. The next column is a combination of first name and last name. That makes the
column right next to it column(2) for the email address. Now I did some concatenation a few days ago and that may have messed up the columns. But if column(1) is Employee Name then the column next to it is the email address. Yet it is null.
What is going on? What happened to email address?
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed
Which form? On frmEmail, the combo's row source is:
SELECT [tblPersonnel].[PersonnelID], [FirstName] & " " & [LastName] AS FullName
FROM tblPersonnel
WHERE (tblPersonnel.BranchHead=No) ORDER BY [FirstName] & " " & [LastName];
So you're only pulling 2 fields there, the ID and your concatenated field.
Okay, so I just have to either pull one more field or find a different control source?
Respectfully,
Lou Reed
Yes, I'd just add the email field to the row source.
Unfortunately, I took the long way around and decided to use the DLookup function.
It did not work as can be seen in the attached file db. The DLookup function in the
form frmEmail. I just got an error. It makes no sense to me.
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed
Don't see why you would bother, but your ID field is numeric so shouldn't have the apostrophes. Plus you're comparing the name in the second column to the numeric ID, which will never work.
Okay, I will just add an email field to the row source and stop this complicated stuff.
Where is the unneeded apostrophes in the ID filed?
What do you mean that I am comparing the name in the second column to the numeric ID?
I just have never used a DLookup function before. I wanted to try it.
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed
For a numeric field you don't want the bits in red:
strWhere = "tblPersonnel.PersonnelID = " & "'" & strWho & "'"
You mean to take them out? Is there a reference that you can give me?
Respectfully,
Lou Reed