Results 1 to 6 of 6
  1. #1
    louise is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    112

    Open query with a form button but then query won't close

    Hello,

    I have a form with a combo box to select a course, and then a button on that form to open a query. The query is a list of members and their emails.

    (The user then copies the column that contains the emails, and pastes it into Outlook (and then deletes the column header).
    This has been the only way I can figure out to easily send emails to a list of people Access.) So... I would be glad for a better suggestion.



    BUT my immediate problem is that the query with the emails will not close using the x above the scroll bar until I click on the tab/name of the query. Then the x works. This is not a problem with any of my other queries, so it may be specific to the button to open the query, but I can't figure out why.

    I would appreciate any help! Thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Did you mean email addresses?

    Sending emails with VBA code is a common topic. Start with https://www.accessforums.net/program...ook-21903.html
    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. #3
    louise is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    112
    Good morning, Thanks for your prompt response.
    Yes, I do mean email addresses.
    I have looked at the site you gave me. Thanks -- I expect I will at some point try that approach. But it seems quite complicated, at least for now.
    Do you have any thoughts about my most urgent question, regarding why the query would not close with the x, like queries not opened through a button do?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Sorry, cannot replicate the issue and never heard of it before. I just tested opening query by VBA and no problem with X close.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  5. #5
    louise is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    112
    Hello,
    I am returning to this question that I posted earlier, with a little more information about it.
    I have a form that opens a query, through a macro OpenQuery command. That is all the macro includes.
    After the query opens, it is possible to copy a column without any problem, which is my intention in doing this.
    But, I cannot close the query. Instead the focus stays with the form. If that is closed with the small x, the focus is still not on the query. I still have to click on the tab of the query to get the focus on it so that the x will close it.

    This is my question now: Is there a way to set the focus on the query in the same macro that opens it? or, any other ideas?
    I prefer not to simply close the form in the macro, because doing that is set to close another form and then the user has lost her main menu.
    Thanks!

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    If user has just done a copy of column to clipboard then focus should now be on the query and user can close with the X so I do not understand the issue and cannot replicate.

    I do not use Tabbed Documents and prefer Overlapping Windows. Also use only VBA.
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 10-13-2015, 02:53 PM
  2. Replies: 4
    Last Post: 10-09-2014, 07:09 PM
  3. Replies: 3
    Last Post: 07-11-2013, 11:52 AM
  4. Replies: 2
    Last Post: 05-11-2012, 11:52 AM
  5. Replies: 11
    Last Post: 01-26-2012, 01:22 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