Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Access Database Report

Options
  • 18-05-2010 9:08am
    #1
    Registered Users Posts: 128 ✭✭


    Hi all,

    I have a database that I set up with some queries that are pulling the data that I want to view.

    I now want to create a report that will allow me to pull each of the queries individually. Most of these queries require some input such as date parameters.

    I have been trying to use the Control Source of the text field but when I run the report it is pops up a window asking for the value and the title of the pop up is the name of the column from the table.

    It should be asking for the date parameters but no matter whether I use a query with or without a date parameter, it keeps asking for this information.

    If I type in a "1", then it still doesnt bring back the correct information.

    Any ideas on what I can do to make this work??


    Many thanks


Comments

  • Registered Users Posts: 1,456 ✭✭✭FSL


    I would normally use a form from which I can get the variable information and the report I wish to print. I then call the appropriate report from the form.

    In the report open event I set the record source to the appropriate query including the variable data.

    Note you need to have any variables you reference in the report which are also referenced in the form declared as public in a module.


  • Registered Users Posts: 128 ✭✭aktelmiele


    Ok, thanks.

    I kind of understand what you are talking about.

    Would it work for the case where I want to output info like this

    Number of hours: Person 1 Person 2 Person 3 etc


    This would have a date critera on it.

    I can make the query on its own and it works fine. Just need it to appear in the report.


  • Registered Users Posts: 1,456 ✭✭✭FSL


    Yes. presumably you have a report with the data fields on it. Each field being a resultant field from a query. Set the report to have events.

    On your form you have a date picker were you select the start and end date.

    You then store the start date and end date in two variables declared as public in your module ( in the example startdate and enddate). (I always subtract 1 day from the start and add 1 day to the end and use > and < rather than between, unless I also require specific times)

    You call the appropriate report.

    In the report open event you set the record source to your query

    Here is a simple example where you are selecting five fields from a table which lie between two dates. The dates are selected at run time.

    Select a,b,c,d,datefield from e where datefield > startdate and datefield < enddate.

    The query can be as simple or as complex as required and the number of variables can also be as many as you need.


  • Registered Users Posts: 6 1laah


    Hi anyone know how I can go about getting a Contacts Database created for and whether they are expensive to do.


Advertisement