Page 4 of 4 FirstFirst 1234
Results 46 to 50 of 50
  1. #46
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, I think that I know what happened. The line of code:



    Code:
     Me.cboEmployeeName.Value = ""
    Sets the value of cboEmployeeName.Value actually Me.cboEmployeeName.Value to nothing and that is why strWho comes out Null in the line strWho = Me.cboEmployeeName.Column(1)

    I cannot explain the second line varTo = Me.cboEmployeeName.Column(2). It only happens with the strWho line (previuos to it) is commented out. I just do not know why it sets varTo to empty. I believe that Null and empty are not the same. So something is going on here.

    Is this correct?

    Respectfully,

    Lou Reed

  2. #47
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I am unsure as to what post you are referring to. I have questions about this code, but the code problem is not anything to do with

    strMeetingID = me.txtMeetingID2

    is over with.

    Just what posts are you referring to?

    Respectfully,

    Lou Reed

  3. #48
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    the line of code is in the screenshots you posted in your last one with attached files. I am not currently able to open your version of access on my computer so I was going by the screen shots you provided.

  4. #49
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    Okay, I am talking about the two lines that set the value of strWho and varTo. Those are the lines that are perplexing to me.

    As I said in an earlier post the reason that strWho was set to Null is that

    Code:
     Me.cboEmployeeName.Value = ""
    Sets them to null. In other words this line sets everything to Null (I think) and so the line pointed out above make strWho equal to Null.

    I am asking if this is why strWho is Null. I do not know. I am just asking.

    The value of

    strMeetingID

    is of no concern to me now. The place where those two variable strWho and varTo get values is of concern to me.

    Anyway, thanks for your help.

    Respectfully,


    Lou Reed

  5. #50
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,967
    Yes, that is why strWho and strBranchhead are empty string (not Null). The combobox is set to empty string in its AfterUpdate event.

    Don't reference the combobox. Reference textbox or field: strWho = Me.txtName


    cboEmployeeName is to select an employee to send address to. strBranchHead is supposed to be who the email is from. Makes no sense to reference the same control for both. Do you need another combobox to allow selection of branch head name?


    cboEmployeeName is set for 4 columns but it has only 3 fields (PersonnelID, FullName, emailaddress) in its RowSource. Doesn't hurt anything.
    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.

Page 4 of 4 FirstFirst 1234
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error in VB code
    By Lou_Reed in forum Access
    Replies: 19
    Last Post: 09-21-2016, 08:50 AM
  2. Error in VB code
    By Lou_Reed in forum Access
    Replies: 1
    Last Post: 09-19-2016, 02:47 PM
  3. code error??
    By Jen0dorf in forum Access
    Replies: 1
    Last Post: 11-14-2015, 12:16 PM
  4. Error in code
    By cbende2 in forum Programming
    Replies: 5
    Last Post: 06-04-2015, 10:39 AM
  5. VBA Code Returning Error Run Time Error 3061
    By tgwacker in forum Access
    Replies: 2
    Last Post: 11-24-2013, 11:00 AM

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