Results 1 to 15 of 15
  1. #1
    Star Lounger
    Join Date
    Oct 2001
    Location
    Blakeslee, Pennsylvania, USA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Have a report call a combo list box for the report (2000)

    I have a report that is based on a query and I have the Subcontractor filed with [Enter Subcontractor Name] which works fine the report is called from a table embedded in the main switchboard form. What I want to do is when I call the report up I want a combo box to pop up based on the subcontractor table to pick from the list and not have to type in the name.

    I have read and read and I was able to create a form to bring up the report but I need the report to bring up the form and have the form dissapear when the OK button is pressed and then have the report pop up.

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Have a report call a combo list box for the report (2000)

    The Northwind.mdb sample database that comes with Access (in C:Program FilesMicrosoft OfficeOfficeSamples) contains a report that demonstrates how to do this. I don't know the exact name in English, it is probably something like Sales by Year. The corresponding form is named Sales by Year Dialog.

  3. #3
    Star Lounger
    Join Date
    Oct 2001
    Location
    Blakeslee, Pennsylvania, USA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Have a report call a combo list box for the report (2000)

    I have tried looking at it and I am confused......... I am kind of a novie when it comes to this stuff ....... Heck it took me almost an hour to get the form to call the report........ Right now if I have the report call the form the reprot opens in front as a blank then the form behind it and then if I pick from the form it opens the correct report but the form doesn't close.....

    I am still learning.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Have a report call a combo list box for the report (2000)

    The Sales by Year (or whatever its name is) report opens the form from the On Open event of the report using DoCmd.OpenForm.
    It is essential to use acDialog as WindowMode argument. This ensures that the actual opening of the report will wait until the form has been closed or hidden.
    The OK button on the form only hides it. This will make the report code resume execution; this code then checks if the form is still in memory.
    The record source of the report is a query with a parameter that refers to the form.

    If you would like to receive more specific help, please provide specific details about what you are trying to accomplish, and/or attach a stripped down, compacted and zipped version of your database.

  5. #5
    Star Lounger
    Join Date
    Oct 2001
    Location
    Blakeslee, Pennsylvania, USA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Have a report call a combo list box for the report (2000)

    Here is the database the form I just called Pick Subcontractor Dialog and I want it to put the info in the query Open Issues by Subcontractor and then have the form close and the report open.

    The report is called from the report table which is in the main switchboard. I need to replicate that same scenario for about 6 other reports so this would be a great help. I can't seem to get the file under 400k to upload here

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Have a report call a combo list box for the report (2000)

    See <post#=378681>post 378681</post#> for instructions to reduce the size of the attachment.

  7. #7
    Star Lounger
    Join Date
    Oct 2001
    Location
    Blakeslee, Pennsylvania, USA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Have a report call a combo list box for the report (2000)

    I think I have it now. Here is the file
    Attached Files Attached Files

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Have a report call a combo list box for the report (2000)

    See modified version and look at the code behind the report and behind the dialog form. There is not a lot of code, so I hope it is clear what it does.
    Attached Files Attached Files

  9. #9
    Star Lounger
    Join Date
    Oct 2001
    Location
    Blakeslee, Pennsylvania, USA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Have a report call a combo list box for the report (2000)

    Worked Fantastic!

    I am trying to do the same thing for the for the Customer Report and I changed the values but now when I run that one I get no data on every customer. If I go to the query drectly I get the data.

    What would cause that.

    Thanks

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Have a report call a combo list box for the report (2000)

    Have you looked at the query that acts as record source of the "Open Issues by Subcontractor" report? It has a parameter [Forms]![Pick Subcontractor Dialog]![cboSubcontractor] that refers to the combo box on the dialog form. You should do something similar in the query for the Customer report.

  11. #11
    Star Lounger
    Join Date
    Oct 2001
    Location
    Blakeslee, Pennsylvania, USA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Have a report call a combo list box for the report (2000)

    I copied the Form then I changed the combo box to look at the customer table then I changed the combo baox name to cboCustomers and then changed the code to reflect that name change and I get that there is no data.

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Have a report call a combo list box for the report (2000)

    Could you post a stripped down copy again?

  13. #13
    Star Lounger
    Join Date
    Oct 2001
    Location
    Blakeslee, Pennsylvania, USA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Have a report call a combo list box for the report (2000)

    Here you go?
    Attached Files Attached Files

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Have a report call a combo list box for the report (2000)

    The bound column of your combo box is CustID, but you put the parameter in the query in the LastName column. You must add CustID and move the parameter to that column. See screenshot.
    Attached Images Attached Images
    • File Type: png x.png (2.1 KB, 0 views)

  15. #15
    Star Lounger
    Join Date
    Oct 2001
    Location
    Blakeslee, Pennsylvania, USA
    Posts
    67
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Have a report call a combo list box for the report (2000)

    Thank you so much I can't believe I didn't see that..........

    Working Great now............. Hans you are the MAN!

    Thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •