Page 7 of 7 FirstFirst 1234567
Results 91 to 93 of 93
  1. #91
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    You are right. In the copying and pasting I somehow left off the emailaddress. Once, I replaced that in the SQL code everything seemed to go alight. Now I have a included an old version (attached file) of my db that has a combo box with employee name and email addresses on frmEmail. This one works. It is slightly different than yours and I am not sure way it does work. In that version the rowsource takes care of the SQL as well. The email text box just has emailaddress in it. Yet it works.

    I have one question: why put the SQL code in rowsource and not control source? Is it because control source must be left blank?



    Also, I know that professionals do not use them, but could the combo box wizard create the row SQL code for this? I am just wondering.

    Any help appreciated. Thanks in advance.

    Respectfully,


    Lou Reed





    I
    Attached Files Attached Files

  2. #92
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    SQL never goes in ControlSource.

    SQL goes in RowSource because that is how to generate the combobox dropdown list.

    Try the wizard. Does it offer an option to create SQL statement? No. It requires selection of table or query object as the RowSource. I prefer to create an SQL statement as RowSource.

    I suggested you leave the combobox ControlSource blank because I see no reason to save the selected name to record. Why would you want to change the data in record? You have yet to describe purpose of frmEmail. Is it to edit data and add new records? Or is it only to locate existing record?

    In Mike's db, combobox selection is changing the email address in the record. And since the combobox and textbox are both bound to the emailaddress field, of course the textbox will display the value selected by the combobox because that value is saved to the field. This is changing the tblPersonnel record.
    Last edited by June7; 06-03-2017 at 03:37 AM.
    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.

  3. #93
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    The db that I posted in Post #92 was written by me, regardless of the name on it. My point is that it seems to work. It was like your suggestion and unlike at the same time. I just found this combo box by using the Wizard over and over again until I got what I wanted. I stumbled upon it.

    It does seem to work. For control source i the email address text box, the control was simply email address. Not what you wrote,=[cbo.... It just seems easier that way. I understand your suggestion and I am grateful for it.

    In order ti fully understand MS Access completely, I just needed to knew the difference. Thta is the purpose of the question.

    Thanks for your help.

    Respectfully,

    Lou Reed

Page 7 of 7 FirstFirst 1234567
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 01-22-2015, 05:27 PM
  2. Double Value Shoes in query
    By nhkhurum in forum Queries
    Replies: 14
    Last Post: 11-16-2013, 03:55 AM
  3. Replies: 6
    Last Post: 04-26-2013, 10:07 AM
  4. Replies: 2
    Last Post: 02-13-2013, 04:14 PM
  5. how to solve this double query
    By gunterhoflack in forum Access
    Replies: 11
    Last Post: 01-28-2013, 07:58 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