Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using data from a form to print report (2002)

    I have a form that I am trying to use to create the data I need to print a report.

    Based on the contents of a combo box and two textboxes I want to generate the report.

    Unfortunately it has gotten a little too involved for me to figure out.

    See attachment and open the form. I explain the problem on the form.

    Thanks.

    Paul

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

    Re: Using data from a form to print report (2002)

    What is the purpose of the combo boxes? They are unbound and there is no code behind them... <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using data from a form to print report (2002)

    The School Year Combo box was to set the year that you would be looking up that would limit the weeks that you would see in the Week combo box. That way you would only see the dates that applied to the correct school year. In the version I sent you I deleted all the other weeks in the table.

    The Week combo box is where you select the week you want and that determines the BegDate and EndDate that the query uses to run the report.

    My big issue was trying to get the BegDate and End Date to appear on the form.

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

    Re: Using data from a form to print report (2002)

    Your form has Data Entry set to Yes, so it will only display new records. All existing records are hidden. Is that intentional?

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Using data from a form to print report (2002)

    I attach a modified version.

    The form is unbound - ie. not connected to a table.
    Include the BegDate and EndDate as extra columns in the Week combo box, then set the Control Source of the two text boxes to expressions like:

    =[cboSelectWeek].[column](1) and
    =[cboSelectWeek].[column](2)

    The query behind cboSelectWeek should use cboSchoolYear as a parameter so that only weeks from the selected year are displayed. cboSelectWeek would then need to be requeried in the after update event of cboSchoolYear. (I have not put this in the attachment.)

    I don't think it works having the form as modal and popup. When the report is opened you can't see it.
    I prefer to use a command button to open the report rather than the after update event. Using the After Update event I think people would open the report unintentionally sometimes.
    Attached Files Attached Files
    Regards
    John



  6. #6
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using data from a form to print report (2002)

    No - did not realize that.

  7. #7
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using data from a form to print report (2002)

    Thanks John

    Your revised form looks like it will do what I need. I work on it on Monday.

    Paul

Posting Permissions

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