Results 1 to 7 of 7
  1. #1
    pg13Reader is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    13

    Form/Report process

    Hello, I’m having difficulty with form/report process.



    Right now I have on the main form a button the user clicks and it opens up a (pop-up) form. On this form they can select from a drop-down list in a combo box it will pull up a report, then closes the pop-up form. The print preview of the report shows up, but once the pop-up form closes the focus goes back to the main form instead of the report. Is there a way to have the focus on the report?

    Here’s the VB code – for the combo box, after update/event procedure:

    DoCmd.OpenReport "r_ReviewDetail", acViewPreview, , , acWindowNormal
    DoCmd.Close acForm, "f_ChooseType", Save

    My goal is to have a drop-down menu list of items in order to filter for a report. How this is accomplished, with a pop-up sub-form, or some other way doesn't matter as long as it works. It seemed like this was the only way…. (initially had a prompt with dialog box where the user had to enter information, but that wasn't working well, people type the wrong info. I need them to choose from a list.)

    Thanks for the help!!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,598
    Try:
    DoCmd.SelectObject acReport, "YourReportName"
    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
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Instead of using a form, have a list box containing the same values as your combo box. Add the open report code to the Double-click event of the list box.

  4. #4
    pg13Reader is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    13
    Quote Originally Posted by June7 View Post
    Try:
    DoCmd.SelectObject acReport, "YourReportName"

    This worked like a charm! Thank you.

    The list box idea sounds good, but if there were additions or deletions to the list, someone (me) would have to modify the list options each time, right? The combo box, while not super elegant at least allows for evolving data.

    Thanks again for all the help!!

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,598
    Actually, a listbox has a RowSource just like a combobox and therefore also allows for 'evolving data'. aytee is suggesting put listbox (or combobox) on the main form instead of the button that opens 'popup' form.
    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.

  6. #6
    pg13Reader is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    13
    I haven't used listboxes too much, the few I do have in my DB have all been done with a list I created instead of pulling from a query or table. Maybe I should look into this further....

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,598
    Listbox or combobox is your preference. The point is that the popup might not be necessary.

    I seldom use listboxes for data selection, usually a combobox. I have used listboxes a lot to just list data for viewing, instead of creating a subform.
    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: 1
    Last Post: 11-28-2011, 12:39 PM
  2. Efficient Process?
    By compooper in forum Database Design
    Replies: 1
    Last Post: 06-14-2011, 03:01 PM
  3. Replies: 3
    Last Post: 03-28-2011, 11:49 AM
  4. Automate Compact and Repair process
    By tracerbullet in forum Security
    Replies: 2
    Last Post: 01-14-2010, 05:12 PM
  5. Process that requires 2 users on 2 machines
    By Rstarr1 in forum Programming
    Replies: 0
    Last Post: 12-17-2008, 03:14 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