Page 3 of 3 FirstFirst 123
Results 31 to 41 of 41
  1. #31
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    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.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #32
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    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
    Attached Files Attached Files

  3. #33
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    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.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #34
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, so I just have to either pull one more field or find a different control source?

    Respectfully,

    Lou Reed

  5. #35
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Yes, I'd just add the email field to the row source.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #36
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    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
    Attached Files Attached Files

  7. #37
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    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.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #38
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    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

  9. #39
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    For a numeric field you don't want the bits in red:

    strWhere = "tblPersonnel.PersonnelID = " & "'" & strWho & "'"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #40
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    You mean to take them out? Is there a reference that you can give me?

    Respectfully,

    Lou Reed

  11. #41
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 01-29-2016, 08:52 PM
  2. Issues with combo boxes
    By Accu-Grind in forum Forms
    Replies: 8
    Last Post: 05-14-2015, 05:24 PM
  3. Issues with Access 2013 combo box
    By Andys in forum Modules
    Replies: 2
    Last Post: 03-06-2014, 05:28 PM
  4. Combo Box Issues on Form
    By aceoftrades in forum Forms
    Replies: 4
    Last Post: 12-28-2013, 12:47 PM
  5. 3rd Combo Box Cascade Issues
    By GAccess in forum Forms
    Replies: 12
    Last Post: 03-06-2012, 03:16 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